Here are the examples of the csharp api class NUnit.Framework.Assert.AreEqual(object, object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
200 Examples
0
1. Example
View licenseprivate void Read(string expectedOutput) { var length = expectedOutput.Length; var actualOutput = console.RetrieveOutput(expectedOutput.Length); Assert.AreEqual(expectedOutput, actualOutput); }
0
2. Example
View license[Test] public void Test_If_Resource_Ends_Without_Slash_Can_Tell_You_Its_Parent_Successfully() { Assert.AreEqual(@"\", new Resource(@"\abc").Parent.Path); }
0
3. Example
View license[Test] public void Test_If_Resource_Ends_With_Slash_Can_Tell_You_Its_Parent_Successfully() { Assert.AreEqual(@"\", new Resource(@"\abc\").Parent.Path); }
0
4. Example
View license[Test] public void Test_If_Nested_Resource_Ends_Without_Slash_Can_Tell_You_Its_Parent_Successfully() { Assert.AreEqual(@"\abc\", new Resource(@"\abc\def").Parent.Path); }
0
5. Example
View license[Test] public void Test_If_Nested_Resource_Ends_With_Slash_Can_Tell_You_Its_Parent_Successfully() { Assert.AreEqual(@"\abc\", new Resource(@"\abc\def\").Parent.Path); }
0
6. Example
View license[Test] public void Test_If_Triple_Nested_Resource_Ends_Without_Slash_Can_Tell_You_Its_Parent_Successfully() { Assert.AreEqual(@"\abc\def\", new Resource(@"\abc\def\ghi").Parent.Path); }
0
7. Example
View license[Test] public void Test_If_Triple_Nested_Resource_Ends_With_Slash_Can_Tell_You_Its_Parent_Successfully() { Assert.AreEqual(@"\abc\def\", new Resource(@"\abc\def\ghi\").Parent.Path); }
0
8. Example
View license[Test] public void Test_If_Paths_Point_To_File_And_Are_Identical_Can_Calculate_Relative_Path() { var from = new Resource(@"\spec\x.html"); var to = new Resource(@"\spec\x.html"); Assert.AreEqual("x.html", from.GetRelativePath(to)); }
0
9. Example
View license[Test] public void Test_If_Paths_Are_Not_Identical_Can_Calculate_Relative_Path() { var from = new Resource(@"\spec\"); var to = new Resource(@"\spec\blah"); Assert.AreEqual(@"blah", from.GetRelativePath(to)); }
0
10. Example
View license[Test] public void Test_If_Paths_Are_Not_Identical_And_End_In_Slashes_Can_Calculate_Relative_Path() { var from = new Resource(@"\a\b\c\"); var to = new Resource(@"\a\b\x\"); Assert.AreEqual(@"..\x\", from.GetRelativePath(to)); }
0
11. Example
View license[Test] public void Test_If_Paths_Are_Weird_And_End_In_Slashes_Can_Calculate_Relative_Path() { var from = new Resource(@"\x\b\c\"); var to = new Resource(@"\a\b\x\"); Assert.AreEqual(@"..\..\..\a\b\x\", from.GetRelativePath(to)); }
0
12. Example
View license[Test] public void Test_If_Paths_Share_Common_Root_And_End_In_Text_File_Can_Calculate_Relative_Path() { var from = new Resource(@"\a\b\c\file.txt"); var to = new Resource(@"\a\x\x\file.txt"); Assert.AreEqual(@"..\..\x\x\file.txt", from.GetRelativePath(to)); }
0
13. Example
View license[Test] public void Test_If_Path_To_Image_And_Path_To_Html_File_Can_Calculate_Relative_Path() { var from = new Resource(@"\spec\concordion\breadcrumbs\Breadcrumbs.html"); var to = new Resource(@"\image\concordion-logo.png"); Assert.AreEqual(@"..\..\..\image\concordion-logo.png", from.GetRelativePath(to)); }
0
14. Example
View license[Test] public void Test_Can_Get_Relative_Resource_From_Another_Resource_File_Successfully() { var resourcePath = @"\blah.html"; var relativePath = @"david.html"; Assert.AreEqual(@"\david.html", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
15. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Root_Path_From_Another_Resource_File_Successfully() { var resourcePath = @"\"; var relativePath = @"david.html"; Assert.AreEqual(@"\david.html", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
16. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Directory_From_Another_Resource_File_Successfully() { var resourcePath = @"\blah\x"; var relativePath = @"david.html"; Assert.AreEqual(@"\blah\david.html", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
17. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_From_Another_Resource_File_Successfully() { var resourcePath = @"\blah\x\y"; var relativePath = @"david.html"; Assert.AreEqual(@"\blah\x\david.html", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
18. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_From_Another_Resource_File_In_A_Directory_Successfully() { var resourcePath = @"\blah\x\y"; var relativePath = @"z\david.html"; Assert.AreEqual(@"\blah\x\z\david.html", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
19. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_From_Another_Resource_File_In_A_SubDirectory_Successfully() { var resourcePath = @"\blah\docs\example.html"; var relativePath = @"..\style.css"; Assert.AreEqual(@"\blah\style.css", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
20. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_And_File_From_Another_Resource_File_In_A_Directory_Successfully() { var resourcePath = @"\blah\docs\example.html"; var relativePath = @"..\..\style.css"; Assert.AreEqual(@"\style.css", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
21. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_And_File_From_Another_Resource_File_In_A_Directory2_Successfully() { var resourcePath = @"\blah\docs\work\example.html"; var relativePath = @"..\..\style.css"; Assert.AreEqual(@"\blah\style.css", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
22. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_And_File_From_Another_Resource_File_In_A_Directory3_Successfully() { var resourcePath = @"\blah\docs\work\example.html"; var relativePath = @"..\style.css"; Assert.AreEqual(@"\blah\docs\style.css", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
23. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_And_File_From_Another_Resource_File_In_A_Directory4_Successfully() { var resourcePath = @"\blah\example.html"; var relativePath = @"..\style.css"; Assert.AreEqual(@"\style.css", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
24. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_And_File_From_Another_Resource_File_In_A_Directory5_Successfully() { var resourcePath = @"\blah\"; var relativePath = @"..\style.css"; Assert.AreEqual(@"\style.css", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
25. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_And_File_From_Another_Resource_File_In_A_Directory6_Successfully() { var resourcePath = @"\blah"; var relativePath = @"style.css"; Assert.AreEqual(@"\style.css", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
26. Example
View license[Test] public void Test_Can_Get_Relative_Resource_With_Multiple_Directory_And_File_From_Another_Resource_File_In_A_Directory7_Successfully() { var resourcePath = @"\blah\docs\work\"; var relativePath = @"..\css\style.css"; Assert.AreEqual(@"\blah\docs\css\style.css", new Resource(resourcePath).GetRelativeResource(relativePath).Path); }
0
27. Example
View license[Test] public void Test_Can_Strip_Drive_Letter_Successfully() { Assert.AreEqual(@"\blah\", new Resource(@"C:\blah\").Path); }
0
28. Example
View license[Test] public void ShouldRemoveTestSuffixes() { var specificationLocator = new ClassNameBasedSpecificationLocator(); var resource = specificationLocator.LocateSpecification(this); var path = resource.Path.Replace(Path.DirectorySeparatorChar, '/'); Assert.AreEqual("Concordion/Test/Internal/SpecificationLocator.html", path, "path from SpecificationLocator contains 'Test'"); }
0
29. Example
View license[Test] public void ShouldNotRemoreWordTestInBetween() { var specificationLocator = new ClassNameBasedSpecificationLocator(); var resource = specificationLocator.LocateSpecification(new DummyContainingTestInNameTest()); var path = resource.Path.Replace(Path.DirectorySeparatorChar, '/'); Assert.AreEqual("Concordion/Test/Internal/DummyContainingTestInName.html", path, "path from SpecificiationLocator removed 'Test' in the middle"); }
0
30. Example
View license[Test] public void Test_Can_Remove_First_Instance_In_Middle_Of_String_Successfully() { var str = "ShouldRemoveThis"; Assert.AreEqual("ShouldThis", str.RemoveFirst("Remove")); }
0
31. Example
View license[Test] public void Test_Can_Remove_First_Instance_In_Middle_Of_String_If_Multiple_Instances_Present_Successfully() { var str = "ShouldRemoveRemoveThis"; Assert.AreEqual("ShouldRemoveThis", str.RemoveFirst("Remove")); }
0
32. Example
View license[Test] public void Test_Can_Remove_First_Instance_At_Start_Of_String_Successfully() { var str = "RemoveThis"; Assert.AreEqual("This", str.RemoveFirst("Remove")); }
0
33. Example
View license[Test] public void Test_Can_Remove_First_Instance_At_End_Of_String_Successfully() { var str = "ShouldRemove"; Assert.AreEqual("Should", str.RemoveFirst("Remove")); }
0
34. Example
View license[Test] public void Test_Can_Return_Same_String_If_SubString_Not_Found_Successfully() { var str = "This"; Assert.AreEqual("This", str.RemoveFirst("Remove")); }
0
35. Example
View license[Test] public void Test_Can_Return_Empty_String_Successfully() { var str = String.Empty; Assert.AreEqual(String.Empty, str.RemoveFirst("Remove")); }
0
36. Example
View license[Test] public void CanMangleSingleGeneric() { Assert.AreEqual("Foo`1<T>", GenericNameMangler.MangleParameterName("Foo<T>")); }
0
37. Example
View license[Test] public void CanMangleFullyQualifiedGeneric() { Assert.AreEqual("System.Collections.Generic.IEnumerable`1<AutoTest.TestRunners.Shared.IAutoTestNetTestRunner>", GenericNameMangler.MangleParameterName("System.Collections.Generic.IEnumerable<AutoTest.TestRunners.Shared.IAutoTestNetTestRunner>")); }
0
38. Example
View license[Test] public void CanMangleMultipleGenerics() { Assert.AreEqual("Foo`2<T,V>", GenericNameMangler.MangleParameterName("Foo<T,V>")); }
0
39. Example
View license[Test] public void DoesNotMangleNameWithoutGenerics() { Assert.AreEqual("Foo", GenericNameMangler.MangleParameterName("Foo")); }
0
40. Example
View license[Test] public void CanHandleNestedGenerics() { Assert.AreEqual("Foo`2<Bar`1<T>,V>", GenericNameMangler.MangleParameterName("Foo<Bar<T>,V>")); }
0
41. Example
View license[Test] public void CanReturnWithoutParameters() { Assert.AreEqual("Foo`2", GenericNameMangler.MangleTypeName("Foo<Bar<T>,V>")); }
0
42. Example
View license[Test] public void CanMangleRemovingGenerics() { Assert.AreEqual("Foo", GenericNameMangler.MangleMethodName("Foo<Bar<T>,V>")); }
0
43. Example
View license[Test] public void CanMangleWithoutGenerics() { Assert.AreEqual("Foo", GenericNameMangler.MangleMethodName("Foo")); }
0
44. Example
View license[Test] public void BagNegate() { // {[12 CHF][7 USD]} negate == {[-12 CHF][-7 USD]} Money[] bag= { new Money(-12, "CHF"), new Money(-7, "USD") }; MoneyBag expected= new MoneyBag(bag); Assert.AreEqual(expected, fMB1.Negate()); }
0
45. Example
View license[Test] public void BagSimpleAdd() { // {[12 CHF][7 USD]} + [14 CHF] == {[26 CHF][7 USD]} Money[] bag= { new Money(26, "CHF"), new Money(7, "USD") }; MoneyBag expected= new MoneyBag(bag); Assert.AreEqual(expected, fMB1.Add(f14CHF)); }
0
46. Example
View license[Test] public void BagSubtract() { // {[12 CHF][7 USD]} - {[14 CHF][21 USD] == {[-2 CHF][-14 USD]} Money[] bag= { new Money(-2, "CHF"), new Money(-14, "USD") }; MoneyBag expected= new MoneyBag(bag); Assert.AreEqual(expected, fMB1.Subtract(fMB2)); }
0
47. Example
View license[Test] public void BagSumAdd() { // {[12 CHF][7 USD]} + {[14 CHF][21 USD]} == {[26 CHF][28 USD]} Money[] bag= { new Money(26, "CHF"), new Money(28, "USD") }; MoneyBag expected= new MoneyBag(bag); Assert.AreEqual(expected, fMB1.Add(fMB2)); }
0
48. Example
View license[Test] public void MixedSimpleAdd() { // [12 CHF] + [7 USD] == {[12 CHF][7 USD]} Money[] bag= { f12CHF, f7USD }; MoneyBag expected= new MoneyBag(bag); Assert.AreEqual(expected, f12CHF.Add(f7USD)); }
0
49. Example
View license[Test] public void MoneyBagHash() { MoneyBag equal= new MoneyBag(new Money(12, "CHF"), new Money(7, "USD")); Assert.AreEqual(fMB1.GetHashCode(), equal.GetHashCode()); }
0
50. Example
View license[Test] public void Normalize() { Money[] bag= { new Money(26, "CHF"), new Money(28, "CHF"), new Money(6, "CHF") }; MoneyBag moneyBag= new MoneyBag(bag); Money[] expected = { new Money(60, "CHF") }; // note: expected is still a MoneyBag MoneyBag expectedBag= new MoneyBag(expected); Assert.AreEqual(expectedBag, moneyBag); }