Unit testing using Mock dataset RRS feed

  • Question

  • User136806914 posted

    Hello guys,

    I am trying to mock dataset on a table(using NUnit framework & Moq). How to create a Mock so foreign key constraint doesn't get violated?

    I am new to Mock testing &  any good tutorials that will help me get upto speed is highly appreciated



    Wednesday, July 10, 2019 2:36 AM

All replies

  • User1120430333 posted

    Using datasets and datatables in Web applications is not an optimal choice that I have experienced. 



    Myself, I have  done a lot of unit testing and mocking as a contractor or as a fulltime employee in various companies. I have never seen a dataset and datatable being used in a unit test or mocked. I have  never seen a collection with custom objects being mocked either, but I have seen a collection of custom objects being arranged with test data being used in unit tess, becuase a collection of  custom objects was being used in the program.

    Wednesday, July 10, 2019 3:10 AM