public void AreEqualFailsWithTextFilesAfterReadingBothFiles() { using (var tf1 = new TestFile("Test1.txt", "TestText1.txt")) using (var tf2 = new TestFile("Test2.txt", "TestText2.txt")) { var expectedMessage = string.Format( " Stream lengths are both {0}. Streams differ at offset {1}." + Environment.NewLine, tf1.FileLength, tf1.OffsetOf('!')); var ex = Assert.Throws <AssertionException>(() => FileAssert.AreEqual(tf1.File.FullName, tf2.File.FullName)); Assert.That(ex.Message, Is.EqualTo(expectedMessage)); } }
public void AreEqualFailsWithTextFilesAfterReadingBothFiles() { using (TestFile tf1 = new TestFile("Test1.txt", "TestText1.txt")) { using (TestFile tf2 = new TestFile("Test2.txt", "TestText2.txt")) { expectedMessage = string.Format( " Stream lengths are both {0}. Streams differ at offset {1}." + Environment.NewLine, tf1.FileLength, tf1.OffsetOf('!')); FileAssert.AreEqual("Test1.txt", "Test2.txt"); } } }
public void AreEqualFailsWithTextFilesAfterReadingBothFiles() { using(TestFile tf1 = new TestFile("Test1.txt","TestText1.txt")) { using(TestFile tf2 = new TestFile("Test2.txt","TestText2.txt")) { var expectedMessage = string.Format( " Stream lengths are both {0}. Streams differ at offset {1}." + Environment.NewLine, tf1.FileLength, tf1.OffsetOf('!')); var ex = Assert.Throws<AssertionException>(() => FileAssert.AreEqual( "Test1.txt", "Test2.txt" )); Assert.That(ex.Message, Is.EqualTo(expectedMessage)); } } }
public void AreEqualFailsWithTextFilesAfterReadingBothFiles() { using(TestFile tf1 = new TestFile("Test1.txt","TestText1.txt")) { using(TestFile tf2 = new TestFile("Test2.txt","TestText2.txt")) { expectedMessage = string.Format( " Stream lengths are both {0}. Streams differ at offset {1}." + Environment.NewLine, tf1.FileLength, tf1.OffsetOf('!')); FileAssert.AreEqual( "Test1.txt", "Test2.txt" ); } } }