Metadata >> NuGet >> TestBase

TestBase

Metadata

Authors Chris F Carroll
Copyrights Copyright Chris F Carroll, 2013
Description *TestBase* gets you off to a flying start when unit testing projects with dependencies. It offers a rich extensible set of fluent assertions and a set of verifiable Fake Ado.Net components, with easy setup and verification. TestBase.Shoulds ------------------ Chainable fluent assertions drill down to the point concisely. UnitUnderTest.Action().ShouldNotBeNullOrEmpty().ShouldContain(x=>x.ExpectedField == expected); * Lots of Shoulds: ShouldBe(),ShouldSatisfy(),ShouldHave(),ShouldBeTrue(),ShouldBeGreaterThan(),ShouldBeLessThan(),ShouldBeGreaterThanOrEqual(),ShouldBeAssignableTo(),ShouldBeBetween(),ShouldBeNullOrEmpty(),... * Enumerable Assertions: ShouldBeEmpty(),ShouldContain(),ShouldContainEachItemOf(),ShouldBeIn(),ShouldHave(),ShouldAll(),... * Lots of Nots: ShouldNotBe(),ShouldNotBeNullOrEmpty(),ShouldNotContain(),... * String & Regex Assertions:ShouldContain(),ShouldEqualIgnoringCase(),ShouldMatch(),ShouldNotBeNullOrEmptyOrWhitespace(),... * StreamAssertions:ShouldContain(stream),ShouldContain(byte[]),ShouldEqualByValue(stream) * ShouldEqualByValue() compares all kinds of objects and collections field-by-field, by value, basis new{f1=1,f2="2"}ShouldEqualByValue(new{f1=1,f2="2"}); new[]{1,2}.ShouldEqualByValue(new List<int>{1,2}); TestBase.FakeDb ------------------ Works with Ado.Net and technologies on top of it, including Dapper. * fakeDbConnection.SetupForQuery(fakeData, new[] {"FieldName1", FieldName2"}) * fakeDbConnection.SetupForExecuteNonQuery(rowsAffected) * fakeDbConnection.Verify(x=>x.CommandText.Matches("Insert MyTable") && x.Parameters["id"].Value==1) TestBase.TestBase<T> AutoMocksAndFakes -------------------------------- is in development and currently works non-recursively. It auto-constructs the UnitUnderTest. It identifies constructor dependencies by name and type, looking in the following places: 1) Fields in the TestFixture class 2) Entries in the Mocks[] or Fake[] dictionaries 3) Finally it creates a Mock (if it's a mockable type) or a default instance (if its sealed, or value type) for anything that's missing See also: TestBase-Mvc for Asp.Net MVC assertions such as ControllerUnderTest.Action().ShouldBeViewResult().ShouldHaveModelOfType<T>().Field1.ShouldEqual(expected); ChangeLog --------- 3.0.2.0 Added ShouldBeLessThan,ShouldBeIn 2.0.5.0 Adds some intellisense and FakeDbConnection.Verify(..., message,args) overload
Owners Chris F Carroll
ProjectUrl http://github.com/chrisfcarroll/TestBase
ReleaseNotes Version 1. Unpolished but in use for over a year
RequireLicenseAcceptance False
Summary *TestBase* for a flying start to unit testing. A rich extensible set of fluent assertions such as ShouldNotBeEmpty().ShouldEqualByValue() etc, and a set of Fake Ado.Net components, with 1 line setup and verification.
Tags nunit tdd fluent assertions mock ado.net
Dependencies Moq:4.0.10827|NUnit:2.6.3
Title TestBase
PackageSize 138883
PackageHashAlgorithm SHA512
PackageHash jv1aOujmyfMwViQeZ02vhEDZ0Dz6OK/glCXGWOsmBhOVh4h8z17Ovs1g/zAZ+3dF988F5Kxb7vXUp7jr80IwGQ==
DownloadCount 000000
CreatedDate 2013-12-27T11:05:46

Access

You can access data for this project using the tools and addresses described below.

NuGet (nuget.exe)

Installing the package (HTTP Basic authentication):
nuget install TestBase -Source     http://nuget.gw.symbolsource.org/Public/NuGet/FeedService.mvc
Installing the package (pre-authenticated):
nuget install TestBase -Source     http://nuget.gw.symbolsource.org/Public/%login%/%key%/NuGet/FeedService.mvc

NuGet (Package Manager Console)

Installing the package (search all configured feeds):
Install-Package TestBase
Installing the package (HTTP Basic authentication):
Install-Package TestBase -Source     http://nuget.gw.symbolsource.org/Public/NuGet/FeedService.mvc
Installing the package (pre-authenticated):
Install-Package TestBase -Source     http://nuget.gw.symbolsource.org/Public/%login%/%key%/NuGet/FeedService.mvc
Uinstalling the package:
Uninstall-Package TestBase

OpenWrap

Installing the package:
o add-wrap TestBase
Uninstalling the package:
o remove-wrap TestBase

Versions

A version is snapshot of a project's source code. It does not need to follow the Major.Minor.Revision.Build numbering pattern. It can be an arbitrary string of text that identifies a release or a build, in particular including meaningful words like beta, RC or RTM.

Name Related
3.0.2.0
3.0.1.1
3.0.1.0
2.0.5.0
2.0.4.1