Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ IDDD_Samples.suo
/iddd_common/obj/
/iddd_identityaccess/bin/
/iddd_identityaccess/obj/
/src/**/bin
/src/**/obj
6 changes: 6 additions & 0 deletions IDDD_Samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iddd_collaboration", "iddd_
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iddd_identityaccess", "iddd_identityaccess\iddd_identityaccess.csproj", "{FE7CF2BC-5070-4CC7-AB31-4E7F12AA65BF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaaSOvation.IdentityAccess.Tests", "src\SaaSOvation.IdentityAccess.Tests\SaaSOvation.IdentityAccess.Tests.csproj", "{73E94CFE-8AC4-4B97-9BB8-4D2959E3962E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -31,6 +33,10 @@ Global
{FE7CF2BC-5070-4CC7-AB31-4E7F12AA65BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE7CF2BC-5070-4CC7-AB31-4E7F12AA65BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE7CF2BC-5070-4CC7-AB31-4E7F12AA65BF}.Release|Any CPU.Build.0 = Release|Any CPU
{73E94CFE-8AC4-4B97-9BB8-4D2959E3962E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73E94CFE-8AC4-4B97-9BB8-4D2959E3962E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73E94CFE-8AC4-4B97-9BB8-4D2959E3962E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73E94CFE-8AC4-4B97-9BB8-4D2959E3962E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ public static Enablement IndefiniteEnablement()
return new Enablement(true, DateTime.MinValue, DateTime.MinValue);
}

public Enablement(bool enabled, DateTime startDate, DateTime endDate)
public Enablement(bool enabled, DateTime? startDate, DateTime? endDate)
{
if (startDate > endDate)
{
throw new InvalidOperationException("Enablement start and/or end date is invalid.");
}

this.Enabled = enabled;
this.EndDate = endDate;
this.StartDate = startDate;
this.EndDate = endDate.GetValueOrDefault(DateTime.MaxValue);
this.StartDate = startDate.GetValueOrDefault(DateTime.MinValue);
}

public bool Enabled { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public bool IsAvailable()
}
else
{
long time = (new DateTime()).Ticks;
long time = DateTime.Now.Ticks;
if (time >= this.StartingOn.Ticks && time <= this.Until.Ticks)
{
isAvailable = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ public bool IsRegistrationAvailableThrough(string invitationIdentifier)
public RegistrationInvitation OfferRegistrationInvitation(string description)
{
AssertionConcern.AssertStateTrue(this.Active, "Tenant is not active.");
AssertionConcern.AssertArgumentTrue(this.IsRegistrationAvailableThrough(description), "Invitation already exists.");
AssertionConcern.AssertArgumentFalse(this.IsRegistrationAvailableThrough(description), "Invitation already exists.");

RegistrationInvitation invitation =
new RegistrationInvitation(
this.TenantId,
new Guid().ToString(),
Guid.NewGuid().ToString(),
description);

AssertionConcern.AssertStateTrue(this.RegistrationInvitations.Add(invitation), "The invitation should have been added.");
Expand Down
Binary file added packages/NUnit.2.6.2/NUnit.2.6.2.nupkg
Binary file not shown.
28 changes: 28 additions & 0 deletions packages/NUnit.2.6.2/NUnit.2.6.2.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>NUnit</id>
<version>2.6.2</version>
<title>NUnit</title>
<authors>Charlie Poole</authors>
<owners>Charlie Poole</owners>
<licenseUrl>http://nunit.org/nuget/license.html</licenseUrl>
<projectUrl>http://nunit.org/</projectUrl>
<iconUrl>http://nunit.org/nuget/nunit_32x32.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>NUnit features a fluent assert syntax, parameterized, generic and theory tests and is user-extensible. A number of runners, both from the NUnit project and by third parties, are able to execute NUnit tests.

Version 2.6 is the seventh major release of this well-known and well-tested programming tool.

This package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner.</description>
<summary>NUnit is a unit-testing framework for all .Net languages with a strong TDD focus.</summary>
<releaseNotes>Version 2.6 is the seventh major release of NUnit.

Unlike earlier versions, this package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner.

The nunit.mocks assembly is now provided by the NUnit.Mocks package. The pnunit.framework assembly is provided by the pNUnit package.</releaseNotes>
<copyright />
<language>en-US</language>
<tags>test testing tdd framework fluent assert theory plugin addin</tags>
</metadata>
</package>
Binary file added packages/NUnit.2.6.2/lib/nunit.framework.dll
Binary file not shown.
Loading