-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#65 - added some initial domain model classes and updated unit tests
- Loading branch information
1 parent
99396ad
commit 43acd3e
Showing
16 changed files
with
954 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using Kingsland.MofParser.Model; | ||
using NUnit.Framework; | ||
using System.Linq; | ||
|
||
namespace Kingsland.MofParser.UnitTests.Helpers | ||
{ | ||
|
||
internal static class ModelAssert | ||
{ | ||
|
||
public static void AreEqual(Module obj1, Module obj2) | ||
{ | ||
Assert.IsNotNull(obj1); | ||
Assert.IsNotNull(obj2); | ||
Assert.AreEqual(obj1.Instances.Count, obj2.Instances.Count); | ||
foreach(var pair in obj1.Instances | ||
.Zip(obj2.Instances, (i1, i2) => (i1, i2))) | ||
{ | ||
ModelAssert.AreEqual(pair.i1, pair.i2); | ||
} | ||
} | ||
|
||
public static void AreEqual(Instance obj1, Instance obj2) | ||
{ | ||
Assert.IsNotNull(obj1); | ||
Assert.IsNotNull(obj2); | ||
Assert.AreEqual(obj1.TypeName, obj2.TypeName); | ||
Assert.AreEqual(obj1.Alias, obj2.Alias); | ||
Assert.AreEqual(obj1.Properties.Count, obj2.Properties.Count); | ||
foreach (var pair in obj1.Properties | ||
.Zip(obj2.Properties, (p1, p2) => (p1, p2))) | ||
{ | ||
ModelAssert.AreEqual(pair.p1, pair.p2); | ||
} | ||
} | ||
|
||
public static void AreEqual(Property obj1, Property obj2) | ||
{ | ||
Assert.IsNotNull(obj1); | ||
Assert.IsNotNull(obj2); | ||
Assert.AreEqual(obj1.Name, obj2.Name); | ||
Assert.AreEqual(obj1.Value, obj2.Value); | ||
} | ||
|
||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -2063,5 +2063,4 @@ private static void LexMethodTest(string mofFilename) | |
|
||
} | ||
|
||
} | ||
/// | ||
} |
Oops, something went wrong.