-
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.
Added tests and support for issue #4
ResolveIdentifiers will determine whether the Cause or Classification is expecting an int or string.
- Loading branch information
Joseph Plant
authored and
Joseph Plant
committed
Oct 10, 2013
1 parent
d6dc6a9
commit 4b76aab
Showing
16 changed files
with
464 additions
and
47 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
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
43 changes: 43 additions & 0 deletions
43
src/AmplaWeb.Data.Tests/Data/Binding/ModelData/DowntimeModelPropertiesUnitTests.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,43 @@ | ||
using System; | ||
using AmplaWeb.Data.Attributes; | ||
using NUnit.Framework; | ||
|
||
namespace AmplaWeb.Data.Binding.ModelData | ||
{ | ||
[TestFixture] | ||
public class DowntimeModelPropertiesUnitTests : TestFixture | ||
{ | ||
[AmplaLocation(Location = "Plant.Area.Downtime")] | ||
[AmplaModule(Module = "Downtime")] | ||
public class StringDowntimeModel | ||
{ | ||
public int Id { get; set; } | ||
public string Cause { get; set; } | ||
public string Classification { get; set; } | ||
} | ||
|
||
[AmplaLocation(Location = "Plant.Area.Downtime")] | ||
[AmplaModule(Module = "Downtime")] | ||
public class IntDowntimeModel | ||
{ | ||
public int Id { get; set; } | ||
public int Cause { get; set; } | ||
public int Classification { get; set; } | ||
} | ||
|
||
[Test] | ||
public void IdModelProperties() | ||
{ | ||
ModelProperties<IntDowntimeModel> modelProperties = new ModelProperties<IntDowntimeModel>(); | ||
Assert.That(modelProperties.ResolveIdentifiers, Is.EqualTo(false)); | ||
} | ||
|
||
[Test] | ||
public void StringModelProperties() | ||
{ | ||
ModelProperties<StringDowntimeModel> modelProperties = new ModelProperties<StringDowntimeModel>(); | ||
Assert.That(modelProperties.ResolveIdentifiers, Is.EqualTo(true)); | ||
} | ||
|
||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
src/AmplaWeb.Data.Tests/Data/Downtime/IdentifierDowntimeModel.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 System; | ||
using AmplaWeb.Data.Attributes; | ||
|
||
namespace AmplaWeb.Data.Downtime | ||
{ | ||
[AmplaLocation(Location = "Plant.Area.Downtime")] | ||
[AmplaModule(Module = "Downtime")] | ||
public class IdentifierDowntimeModel | ||
{ | ||
public int Id { get; set; } | ||
public string Location { get; set; } | ||
|
||
[AmplaField(Field = "Start Time")] | ||
public DateTime StartTime { get; set; } | ||
|
||
[AmplaField(Field = "Cause Location")] | ||
public string CauseLocation { get; set; } | ||
|
||
/// <summary> | ||
/// Uso | ||
/// </summary> | ||
public int Cause { get; set; } | ||
|
||
public int Classification { get; set; } | ||
} | ||
} |
Oops, something went wrong.