
GitHub: https://realdotnetdave.github.io/dotNetTips.Spargine/
NuGet: http://bit.ly/dotNetDaveNuGet
Assemblies
Below is the list of the assemblies that are being released today (more to come) and descriptions.
dotNetTips.Spargine.Core
This assembly contains code that is used by all the other assemblies. Just some of the of what is contained are:
- Application information
- CachedEnumerable
- Common collection types
- Collection
- FastSortedList
- ObservableHashSetSingleton
- ObservableList
- ChannelQueue
- ConcurrentHashSet
- DistinctBlockingCollection
- DistinctConcurrentBag
- Computer information
- Custom Exceptions
- Encryption
- Exception thrower
- Logging
- Password Hasher
- PerformanceStopWatch
- Serialization: XML and JSON!
- Validator: Validates method parameters and other validations.
- Web: ServiceProxy and Web helper methods
dotNetTips.Spargine.Extensions
This assembly contains all the extension methods used by the assemblies. Over 39 classes so far! Here are some of the highlights:
- Assembly information
- Collections: Array, Collection, Dictionary, Enumerable, HashSet, ImmutableArray, List, ObservableCollection, SortedDictionary, SortedSet
- DataContext
- DateTime
- DirectoryInfo
- Enum
- Exceptions
- HttpClient, HttpConttext, HttpRequest, HttpResponse header
- Logging
- LINQ
- Numeric
- Object
- Process
- Stream
- String
- StringBuilder
- Task
- Thread
- Type
- WebClient
dotNetTips.Spargine
This assembly contains more higher-level code and/ or specific to Windows. I will be adding a lot more to this assembly, but this is what it contains so far:
- Directly and File helpers
- HttpClient helper
- InMemoryCache
- Services: Start and stop services along with getting a list of services.
- Sockets helper
- Registry extensions.
dotNetTips.Spargine.Tester
This assembly was converted from dotNetTips.Utility.Core.Tester for use in unit tests and benchmarking tests. The main class in this assembly is called RandomData that helps generate random data. Along with that, new types using the new record class types in .NET 5 along with methods to generate the data.
I have written about this assembly in this article: https://www.c-sharpcorner.com/article/unit-testing-with-random-data/
I use this assembly in ALL my unit tests and benchmark tests!
dotNetTips.Spargine.Benchmarking
Since I now have many benchmarking test projects using BenchMarkDotnet, I decided to move the common code for these projects into this new assembly. The main classes are:
- Benchmark: Base class for all benchmark tests. This contains common info and sets a default configuration using attributes. For example, I configure all the export formats here and ordering.
- CounterBenchmark: This class features a counter used in most of the benchmark tests that allows the tests to run with multiple collection counts used to generate data. This class also pre-creates many of the collections used in testing.
- CollectionBenchmark: Class used for all the benchmark tests for collection types.
Now when I need to create a new benchmarking project and classes, this assembly makes it very easy and consistent!
Articles (Documentation)
- FIFTH RELEASE: New code for hashing passwords with PBKDf2 and SHA256, string compression using GZip or Brotli, validating string length, validating string data types, methods for inspecting types, new extensions methods for numbers, and more!
- FORTH RELEASE: New methods that encrypt and decrypt strings, runing async tasks synchronously, fire and forget async methods, safely searching a directory, how to create a thread-safe queue, PickRandom<T>() for ReadOnlySpan<T> and more.
- THIRD RELEASE: New methods that retrieve application information, retrieve common environment variables, retrieve reference assemblies, and more.
- SECOND RELEASE: Changes for this release includes removing carriage return and line feeds from strings, retrieving property values, IsEnumerable() that determines if a type is a collection, safely loading a list of files, validating for null, validating parameters for null, validating an object, base type for record types, creating a blocking collection, moving files with options and more.
- FIRST RELEASE: Changes include Logging application information, logging computer information, retrieving property names & values, converting a Dictionary to a delimited string, converting object properties to a Dictionary, converting obje3ct property values to a string, returning a formatted string from a DataTime, returning a formatted string from a number, creating an enumeration without using Enum.
Unit Testing
I wanted to release these assemblies in January, then February but had to wait until now due to all the unit tests I have been writing or re-working. I wanted to have 75% coverage or better but am currently at 53%. I will continue to strive for 100% coverage for the new code while I fill in the rest.
If you would like to help with writing unit tests, please email me at dotnetdave@live.com. Not only will you get your name listed as a contributor, which could help with job interviews, then I will send you dotNetTips.com swag! If you live in the United States, I will send you one of my books too (as supplies last).
One thing I have really, really wished worked for .NET 7 is IntelliTests since I could have had this work done a long time ago. If you want IntelliTests back in .NET 7, please vote by going here: https://developercommunity.visualstudio.com/idea/359250/add-intellitest-support-for-net-corestandard.html
Looking for Contributors!
Do you have common code that you have written that you would like to contribute to this project? I am always looking for this type of code, so please download the source, make your improvements, and then submit a pull request!
If I accept it (make sure you follow the coding standards in my book), I will send you dotNetTips.com swag and if you live in the U.S., one of my books (while supplies last). I have a lot of swag sitting in my home due to not speaking in person for over a year!
To contribute, go to https://github.com/RealDotNetDave/dotNetTips.Spargine
Summary
I hope you will check out these assemblies. Stay tuned to this site for upcoming quarterly releases! If you have any comments or suggestions, please comment below. I am always looking for new ideas for these open-source projects!