dotNetTips.Utility.Standard Tester

Recently, while working on one of my books, I needed to randomly create data for use in tests and benchmarking of the code. I took what I wrote and created a new NuGet package titled dotNetTips.Utility.Standard.Tester. Below are the major features.

Data Models

There are a few data models that I have created for use in my testing.

Coordinate

The Coordinate type is a simple structure. Coordinate inherits from ICoordinate along with CoordinateFixed that adds operators and overrides a few methods. Details below.

CoordinateClassDiagram

Person

The Person type is a real-world object that I use to test a business object, simular to one that might be used for a Entity Framework or ASP.NET MVC model. Person inherits from IPerson. Person represents a typical model class. PersonFixed inherits from Person and overrides the operators and a few other methods. PersonProper inherits from IPerson and is simular to PersonFixed but adds validation to the properties. Something required for Object Oriented Programming (encapsulaton). Details below.

PersonClassDiagram

Generating Data

To help with generating the custom data models, there is a class called RandomData that will do that along with other features listed below.

  • GenerateCharacter: Creates a random character with overloads.
  • GenerateCoordinate: Creates a Coordinate object with random x and y values.
  • GenerateCoordinateCollection: Creates Coordinate objects in a List collection.
  • GenerateDecimal: Creates a random decimal value.
  • GenerateEmailAddress: Creates a random email address.
  • GenerateInteger: Creates a random integer.
  • GenerateKey: Creates a unique key value (based off of a Guid).
  • GenerateNumber: Creates a random string of numbers.
  • GeneratePerson: Creates a Person object with random values for all of the properties.
  • GeneratePersonCollection: Creates a PersonCollection.
  • GenerateUrl: Creates a random Url address.
  • GenerateWord: Generates a random word for the given length.
  • More!

NuGet

This library is available via NuGet for your .NET projects by going to: https://www.nuget.org/profiles/davidmccarter

Open-Source

This project is open-source. You can contribute or view the code by going to: https://dotnettips.visualstudio.com/dotNetTips.Utility.Standard.Tester

Releases

  • 2019.8.14: Initial release on August, 14th 2019

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.