-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from JGrzybowski/HVAC-23
HVAC-23 Symulacja upływu czasu z kontrolą prędkości Closes #23
- Loading branch information
Showing
49 changed files
with
1,095 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
using System; | ||
using NodaTime; | ||
|
||
namespace OfficeHVAC.Models | ||
{ | ||
public interface ITimeSource | ||
{ | ||
DateTime Now { get; } | ||
} | ||
public interface ITimeSource : IClock { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NodaTime" version="1.3.2" targetFramework="net452" /> | ||
<package id="NodaTime.Testing" version="1.3.2" targetFramework="net452" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
OfficeHVAC.Modules.TimeSimulation.Tests/ControlledTimeSource/AddXYZ.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using NodaTime; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace OfficeHVAC.Modules.TimeSimulation.Tests.ControlledTimeSource | ||
{ | ||
public class AddXYZ | ||
{ | ||
private static readonly Instant InitialTime = Instant.FromUtc(2000, 12, 01, 12, 00, 00); | ||
|
||
[Fact] | ||
public void can_change_time_in_hours() | ||
{ | ||
//Arrange | ||
var clock = new TimeSources.ControlledTimeSource(InitialTime); | ||
|
||
//Act | ||
clock.AddHours(3); | ||
|
||
//Assert | ||
clock.Now.ShouldBe(InitialTime + Duration.FromHours(3)); | ||
} | ||
|
||
[Fact] | ||
public void can_change_time_in_minutes() | ||
{ | ||
//Arrange | ||
var clock = new TimeSources.ControlledTimeSource(InitialTime); | ||
|
||
//Act | ||
clock.AddMinutes(3); | ||
|
||
//Assert | ||
clock.Now.ShouldBe(InitialTime + Duration.FromMinutes(3)); | ||
} | ||
|
||
[Fact] | ||
public void can_change_time_in_seconds() | ||
{ | ||
//Arrange | ||
var clock = new TimeSources.ControlledTimeSource(InitialTime); | ||
|
||
//Act | ||
clock.AddSeconds(3); | ||
|
||
//Assert | ||
clock.Now.ShouldBe(InitialTime + Duration.FromSeconds(3)); | ||
} | ||
|
||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
OfficeHVAC.Modules.TimeSimulation.Tests/ControlledTimeSource/Constructor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using NodaTime; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace OfficeHVAC.Modules.TimeSimulation.Tests.ControlledTimeSource | ||
{ | ||
public class Constructor | ||
{ | ||
private static readonly Instant InitialTime = Instant.FromUtc(2000, 12, 01, 12, 00, 00); | ||
|
||
[Fact] | ||
public void returns_initial_time_after_being_constructed() | ||
{ | ||
//Arrange | ||
var clock = new TimeSources.ControlledTimeSource(InitialTime); | ||
|
||
//Assert | ||
clock.Now.ShouldBe(InitialTime); | ||
} | ||
|
||
[Fact] | ||
public void sets_initial_speed_to_1() | ||
{ | ||
//Arrange | ||
var clock = new TimeSources.ControlledTimeSource(InitialTime); | ||
|
||
//Assert | ||
clock.Speed.ShouldBe(1); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
OfficeHVAC.Modules.TimeSimulation.Tests/ControlledTimeSource/Reset.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using NodaTime; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace OfficeHVAC.Modules.TimeSimulation.Tests.ControlledTimeSource | ||
{ | ||
public class Reset | ||
{ | ||
private static readonly Instant InitialTime = Instant.FromUtc(2000, 12, 01, 12, 00, 00); | ||
|
||
[Fact] | ||
public void sets_new_value_of_Now() | ||
{ | ||
//Arrange | ||
var clock = new TimeSources.ControlledTimeSource(InitialTime); | ||
var newInstant = InitialTime - Duration.FromHours(-15); | ||
|
||
//Act | ||
clock.Reset(newInstant); | ||
|
||
//Assert | ||
clock.Now.ShouldBe(newInstant); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.