Tag Archives: unittest

Common.Logging

Image courtesy of Ales Krivec / unsplash.com https://www.nuget.org/packages/Common.Logging/ Common.logging provides an abstraction for the logging framework of choice. For IoC the common.logging offers an interface. NoOpLogger is a fake implementation used for unit testing. I prefer to use the nuget from log4net with … Continue reading

Posted in Development, Tooling | Tagged , , , , , | Leave a comment

Unity

Image courtesy of Tim Gouw / unsplash.com https://www.nuget.org/packages/Unity/ Dependency Inversion is one of the SOLID principles. An IoC container is a must for me when developing. Unity is my goto framework for the last year. I prefer Unity for it’s lifetime control options. Do … Continue reading

Posted in Development, Tooling | Tagged , , , | Leave a comment

Effort: Unhandled exception while trying to initialize the content of Table

We use Effort with the CsvDataLoader in our integration tests. After adding a new data file we got an exception. On the forum every thread ended with something like “my bad” or “never mind”. Looking closer to my csv file showed the error: a typo … Continue reading

Posted in Test | Tagged , , , | Leave a comment

Entity Framework Fake ObjectContext Realization Tool

With Effort (Entity Framework Fake ObjectContext Realization Tool) I can create integration tests for the datalayer in my project. The tool has an Entity Framework provider that works on an in-memory database. This means I can call SaveChanges without mocking it or having a dependency on a … Continue reading

Posted in Development | Tagged , , | Leave a comment

Be careful when using mocked repository

One of the software development best practices is to use interfaces and dependency injection. But be careful when using a mocked version of your repository. With FakeDbSet an InMemory IDbSet can be created for unit testing purposes. During setup you’d … Continue reading

Posted in Test | Tagged , , , , , | Leave a comment

MSTest Code Coverage with runsettings

I’ve been fine tuning my code coverage runsettings file for some time now and I’m ready to share it with the world. You can use it in Visual Studio by setting the test settings file. In MSBuild you can specify … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

Ignore integration tests when provider is missing

As an integration test I’ve written some unit tests for my MsAccess Data Access Layer. The provider I’m using is OleDb. It will be installed on every desktop machine, but not on our build server. The build fails because of … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment