C# - Collection Validator Library

Σε Εξέλιξη Αναρτήθηκε Dec 12, 2012 Πληρώθηκε κατά την παράδοση
Σε Εξέλιξη Πληρώθηκε κατά την παράδοση

The aim of this project is to build a simple open source library to validate collections of objects. It can incorporate open source solutions such FluentValidation and the likes, and must be fully unit tested and follow stylecop standards.

I intend to make this project open source once it is complete. The best way to describe this project is by an example.

The way I would like to use this library would be like this (The code below is only intended to give you an idea of what I am after.):

var stringCollection = new List();

// Add some strings to the list here.

CollectionValidator myStringCollectionValidator = new CollectionValidator();

[login to view URL]().CountGreaterThan(3).CountLessThan(10);

var collectionValidationResults = [login to view URL](stringCollection);

For a collection of objects which is made up of multiple fields:

class myObject

{

public int ID {get;set;}

public string FirstName {get;set;}

public string LastName {get;set;}

}

var myObjectCollection = new List();

// Add some myObjects to the collection

// The myObjectValidator will validate each myObject in the collection.

CollectionValidator myObjectCollectionValidator = new CollectionValidator(myObjectValidator);

[login to view URL](x => [login to view URL]).Unique(x => [login to view URL], x => [login to view URL]).CountGreaterOrEqualTo(3);

var collectionValidationResults = [login to view URL](myObjectCollection);

The Unique() test will be overloaded to accept a variable or not. If it does not accept a variable it will simply check that all objects in the collection are unique. If it finds a duplicate, the index will be recorded.

If the Unique() test accepts a variable then the Property or the field of the Object needs to be checked for uniqueness.

If you have any questions please feel free to ask.

.NET Γλώσσα Προγραμματισμού C# Μηχανολογία Αρχιτεκτονική Λογισμικού Δοκιμή Λογισμικού

Ταυτότητα Εργασίας: #4036488

Σχετικά με την εργασία

7 προτάσεις Απομακρυσμένη εργασία Ενεργό Dec 13, 2012