NuGet Libraries I currently like

While these are libraries that I'm using in my specific project, I find these libraries generally useful, and for my own sake, I'm recording them and what I like about them.


I have become a true believer in DI and IoC. My designs and my code are cleaner and easier to test. It took a while to really master this, but it has been worth it.

SimpleInjector is fast and it just works. The key to making it work easily is making sure to have a specific place in each archetype of application where the container is instantiated, where it can be made available to the top level operations that need to get instances from the container or have the container registered with a factory.



In this project, I'm using EF very lightly, but it's definitely my go-to solution for most things RDBMS related.

As a side note, I don't hate ADO.NET DataSets, or DataReaders, or other ORM libraries. This is just the one I am comfortable with now.



I'm getting better at TDD. I am not religious about it, but I find that it gets easier and I get better at keeping my tests up to date when I approach code work this way.

xUnit, the library written by the person/team responsible for NUnit, seems simpler to use than the Microsoft unit testing framework.

I used to be quite biased towards using Microsoft libraries for most things if Microsoft made a library available for what I needed. NuGet has changed that a bit. Before, if I selected a third party library, there was a good chance that I wouldn't be able to use it for some other project. That's not as true as it used to be. Also, the xunit.extensions and the runner for Visual Studio 2012 and 2013 Visual Studio Extension do a great job of integrating xUnit with Visual Studio. Even ReSharper integrates pretty well with it.



For creating mocks, I keep coming back to Moq. It's simple to use, verifies what I want it to verify, and generally just works. Someday I will try out some other mocking libraries, but for now I like this one.



AutoFixture itself has more features that I am not taking advantage of. But it enables the other two features which greatly reduce the time I spend writing tests.

AutoFixture.AutoMoq makes it trivial for me to use Moq to provide all the extraneous support classes I need to work the System Under Test (SUT).

AutoFixture.Xunit allows me to create [Theory] unit tests instead of just [Fact] unit tests, and it automatically supplies, as parameters, sets of data which can be used by the SUT. It could even provide the SUT as a parameter to the test.



You know, I know that "fluent" APIs are just, as they say, "syntactic sugar" in that there are no new features, just new ways of expressing an intention in code. But I have to agree with the proponents that it's just easier to mentally process the code when it's written this way.



I hope these are just self-explanatory. Someday, I am sure I will write a better blog post about this great set of libraries (and some others I didn't list here).



Is there a faster serializer? Maybe. But this one is pretty fast.



Microsoft does provide a compression library, and it's pretty good, and I will use the Microsoft library for most basic tasks. In my project, I found that I needed more features than were readily available in the Microsoft library, and the DotNetZip package is more up to date than its nearest competitor, SharpZipLib. It works pretty well.



Actually, I'm only just about to use this, but from what I've seen, this is a fast HTML parser that doesn't require a full DOM load, and yet also supports XPath queries.





It turned out to be quite a lot simpler and easier to get Redis deployed than I was afraid it would be for a Windows port of a Unix-based tool. The ServiceStack libraries make working with Redis from C# just flat trivial.


Alan McBee

comments powered by Disqus