Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Testing advice....please

Testing advice....please

Scheduled Pinned Locked Moved C#
databasecomtestingbeta-testinghelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tadhg88
    wrote on last edited by
    #1

    Hi All, I have just written a console app to add booking info to a database based on emails pulled from an inbox. The app seems to work fine but I would like to write some tests to allow me to regularly/quickly test the functionality when somebody decides to send a surprise email format. The app is pretty basic, an Import class to represent each of the possible client emails and an Importer class to handle the actual creating of the booking in the db both of which have an interface defined to set a base of functionality required by each(IImport and IBookingImporter). Pic of project structure below. http://www.imagebam.com/image/a1cf9a322230061[^] I have a basic understanding of testing and have briefly used NUnit before but I'm just wondering if anyone has a good articles or resource(more specific than google) to help set me on the correct road to writing some tests for each of the Imports. A specific concern would be how i am going to represent/mock i guess, the email service and retrieve the mails. Although any help or advice would really be appreciated, thanks in advance

    S B T 3 Replies Last reply
    0
    • T tadhg88

      Hi All, I have just written a console app to add booking info to a database based on emails pulled from an inbox. The app seems to work fine but I would like to write some tests to allow me to regularly/quickly test the functionality when somebody decides to send a surprise email format. The app is pretty basic, an Import class to represent each of the possible client emails and an Importer class to handle the actual creating of the booking in the db both of which have an interface defined to set a base of functionality required by each(IImport and IBookingImporter). Pic of project structure below. http://www.imagebam.com/image/a1cf9a322230061[^] I have a basic understanding of testing and have briefly used NUnit before but I'm just wondering if anyone has a good articles or resource(more specific than google) to help set me on the correct road to writing some tests for each of the Imports. A specific concern would be how i am going to represent/mock i guess, the email service and retrieve the mails. Although any help or advice would really be appreciated, thanks in advance

      S Offline
      S Offline
      Simon_Whale
      wrote on last edited by
      #2

      have a read of these here on CP code project TDD articles and videos[^]

      Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

      1 Reply Last reply
      0
      • T tadhg88

        Hi All, I have just written a console app to add booking info to a database based on emails pulled from an inbox. The app seems to work fine but I would like to write some tests to allow me to regularly/quickly test the functionality when somebody decides to send a surprise email format. The app is pretty basic, an Import class to represent each of the possible client emails and an Importer class to handle the actual creating of the booking in the db both of which have an interface defined to set a base of functionality required by each(IImport and IBookingImporter). Pic of project structure below. http://www.imagebam.com/image/a1cf9a322230061[^] I have a basic understanding of testing and have briefly used NUnit before but I'm just wondering if anyone has a good articles or resource(more specific than google) to help set me on the correct road to writing some tests for each of the Imports. A specific concern would be how i am going to represent/mock i guess, the email service and retrieve the mails. Although any help or advice would really be appreciated, thanks in advance

        B Offline
        B Offline
        BobJanova
        wrote on last edited by
        #3

        Some TDD articles would indeed be good reading, although you're not strictly doing TDD if you add tests afterwards. The most important thing is to isolate the component that you're testing behind boundary interfaces. It seems like you have already isolated the import process service, behind IImport/IBookingImporter. You also need to isolate the input (IMessageProvider, maybe, for the email source) and output (IBookingRecipient for the database connection code). Then you can provide different implementations of those in your unit test library which give fixed, well known messages as input, and log the bookings the database would be asked to make (the output).

        1 Reply Last reply
        0
        • T tadhg88

          Hi All, I have just written a console app to add booking info to a database based on emails pulled from an inbox. The app seems to work fine but I would like to write some tests to allow me to regularly/quickly test the functionality when somebody decides to send a surprise email format. The app is pretty basic, an Import class to represent each of the possible client emails and an Importer class to handle the actual creating of the booking in the db both of which have an interface defined to set a base of functionality required by each(IImport and IBookingImporter). Pic of project structure below. http://www.imagebam.com/image/a1cf9a322230061[^] I have a basic understanding of testing and have briefly used NUnit before but I'm just wondering if anyone has a good articles or resource(more specific than google) to help set me on the correct road to writing some tests for each of the Imports. A specific concern would be how i am going to represent/mock i guess, the email service and retrieve the mails. Although any help or advice would really be appreciated, thanks in advance

          T Offline
          T Offline
          tadhg88
          wrote on last edited by
          #4

          thanks very much for taking the time to reply gentlemen, i will be investigating further when i have some more time to spend on this... cheers again!!!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups