当前位置: 首页>>代码示例>>C#>>正文


C# Tests.TestFile类代码示例

本文整理汇总了C#中NUnit.Framework.Tests.TestFile的典型用法代码示例。如果您正苦于以下问题:C# TestFile类的具体用法?C# TestFile怎么用?C# TestFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TestFile类属于NUnit.Framework.Tests命名空间,在下文中一共展示了TestFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AreEqualFailsWithFiles

		public void AreEqualFailsWithFiles()
		{
			string expected = "Test1.jpg";
			string actual = "Test2.jpg";
            using (TestFile tf1 = new TestFile(expected, "TestImage1.jpg"))
			{
                using (TestFile tf2 = new TestFile(actual, "TestImage2.jpg"))
				{
					expectedMessage =
						string.Format("  Expected Stream length {0} but was {1}." + Environment.NewLine,
							new FileInfo(tf1.FileName).Length, new FileInfo(tf2.FileName).Length);
					FileAssert.AreEqual( tf1.FileName, tf2.FileName );
				}
			}
		}
开发者ID:rmterra,项目名称:AutoTest.Net,代码行数:15,代码来源:FileAssertTests.cs

示例2: AreEqualPassesWithTextFiles

		public void AreEqualPassesWithTextFiles()
		{
			using(TestFile tf1 = new TestFile("Test1.txt","NUnit.Framework.Tests.TestText1.txt"))
			{
				using(TestFile tf2 = new TestFile("Test2.txt","NUnit.Framework.Tests.TestText1.txt"))
				{
					FileAssert.AreEqual( "Test1.txt", "Test2.txt" );
				}
			}
		}
开发者ID:taoxiease,项目名称:asegrp,代码行数:10,代码来源:FileAssertTests.cs

示例3: AreEqualFailsWithFileInfos

		public void AreEqualFailsWithFileInfos()
		{
            using (TestFile tf1 = new TestFile("Test1.jpg", "TestImage1.jpg"))
			{
                using (TestFile tf2 = new TestFile("Test2.jpg", "TestImage2.jpg"))
				{
					FileInfo expected = new FileInfo( tf1.FileName );
					FileInfo actual = new FileInfo( tf2.FileName );
					expectedMessage =
						string.Format("  Expected Stream length {0} but was {1}." + Environment.NewLine,
							expected.Length, actual.Length);
					FileAssert.AreEqual( expected, actual );
				}
			}
		}
开发者ID:rmterra,项目名称:AutoTest.Net,代码行数:15,代码来源:FileAssertTests.cs

示例4: AreNotEqualFailsWithStreams

		public void AreNotEqualFailsWithStreams()
		{
			using(TestFile tf1 = new TestFile("Test1.jpg","TestImage1.jpg"))
			using(TestFile tf2 = new TestFile("Test2.jpg","TestImage1.jpg"))
			using(FileStream expected = File.OpenRead(tf1.FileName))
			using(FileStream actual = File.OpenRead(tf2.FileName))
			{
				expectedMessage = 
					"  Expected: not <System.IO.FileStream>" + Environment.NewLine +
					"  But was:  <System.IO.FileStream>" + Environment.NewLine;
				FileAssert.AreNotEqual( expected, actual );
			}
		}
开发者ID:rmterra,项目名称:AutoTest.Net,代码行数:13,代码来源:FileAssertTests.cs

示例5: AreNotEqualFailsWithFiles

		public void AreNotEqualFailsWithFiles()
		{
			using(TestFile tf1 = new TestFile("Test1.jpg","TestImage1.jpg"))
			{
				expectedMessage = 
					"  Expected: not <System.IO.FileStream>" + Environment.NewLine +
					"  But was:  <System.IO.FileStream>" + Environment.NewLine;
				FileAssert.AreNotEqual( tf1.FileName, tf1.FileName );
			}
		}
开发者ID:rmterra,项目名称:AutoTest.Net,代码行数:10,代码来源:FileAssertTests.cs

示例6: AreNotEqualPassesWithStreams

		public void AreNotEqualPassesWithStreams()
		{
            using (TestFile tf1 = new TestFile("Test1.jpg", "TestImage1.jpg"))
			{
                using (TestFile tf2 = new TestFile("Test2.jpg", "TestImage2.jpg"))
				{
					using(FileStream expected = File.OpenRead(tf1.FileName))
					{
						using(FileStream actual = File.OpenRead(tf2.FileName))
						{
							FileAssert.AreNotEqual( expected, actual);
						}
					}
				}
			}
		}
开发者ID:rmterra,项目名称:AutoTest.Net,代码行数:16,代码来源:FileAssertTests.cs

示例7: AreNotEqualPassesWithFileInfos

		public void AreNotEqualPassesWithFileInfos()
		{
            using (TestFile tf1 = new TestFile("Test1.jpg", "TestImage1.jpg"))
			{
                using (TestFile tf2 = new TestFile("Test2.jpg", "TestImage2.jpg"))
				{
					FileInfo expected = new FileInfo( tf1.FileName );
					FileInfo actual = new FileInfo( tf2.FileName );
					FileAssert.AreNotEqual( expected, actual );
				}
			}
		}
开发者ID:rmterra,项目名称:AutoTest.Net,代码行数:12,代码来源:FileAssertTests.cs

示例8: NonReadableStreamGivesException

 public void NonReadableStreamGivesException()
 {
     using (TestFile tf1 = new TestFile("Test1.jpg", "TestImage1.jpg"))
     using (TestFile tf2 = new TestFile("Test2.jpg", "TestImage1.jpg"))
     {
         using (FileStream expected = File.OpenRead("Test1.jpg"))
         {
             using (FileStream actual = File.OpenWrite("Test2.jpg"))
             {
                 FileAssert.AreEqual(expected, actual);
             }
         }
     }
 }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:14,代码来源:FileAssertTests.cs

示例9: AreEqualFailsWithStreams

		public void AreEqualFailsWithStreams()
		{
			string expectedFile = "Test1.jpg";
			string actualFile = "Test2.jpg";
            using (TestFile tf1 = new TestFile(expectedFile, "TestImage1.jpg"))
			{
                using (TestFile tf2 = new TestFile(actualFile, "TestImage2.jpg"))
				{
					using(FileStream expected = File.OpenRead(expectedFile))
					{
						using(FileStream actual = File.OpenRead(actualFile))
						{
							expectedMessage =
								string.Format("  Expected Stream length {0} but was {1}." + Environment.NewLine,
									new FileInfo(expectedFile).Length, new FileInfo(actualFile).Length);
							FileAssert.AreEqual( expected, actual);
						}
					}
				}
			}
		}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:21,代码来源:FileAssertTests.cs

示例10: AreEqualPassesWithStreams

		public void AreEqualPassesWithStreams()
		{
			using(TestFile tf1 = new TestFile("Test1.jpg","NUnit.Framework.Tests.TestImage1.jpg"))
			using(TestFile tf2 = new TestFile("Test2.jpg","NUnit.Framework.Tests.TestImage1.jpg"))
			{
				using(FileStream expected = File.OpenRead("Test1.jpg"))
				{
					using(FileStream actual = File.OpenRead("Test2.jpg"))
					{
						FileAssert.AreEqual( expected, actual );
					}
				}
			}
		}
开发者ID:taoxiease,项目名称:asegrp,代码行数:14,代码来源:FileAssertTests.cs

示例11: AreEqualFailsWithTextFilesAfterReadingBothFiles

		public void AreEqualFailsWithTextFilesAfterReadingBothFiles()
		{
			using(TestFile tf1 = new TestFile("Test1.txt","TestText1.txt"))
			{
				using(TestFile tf2 = new TestFile("Test2.txt","TestText2.txt"))
				{
					expectedMessage =
						"  Stream lengths are both 65600. Streams differ at offset 65597." + Environment.NewLine;
					FileAssert.AreEqual( "Test1.txt", "Test2.txt" );
				}
			}
		}
开发者ID:Phaiax,项目名称:dotnetautoupdate,代码行数:12,代码来源:FileAssertTests.cs

示例12: AreNotEqualIteratesOverTheEntireFile

		public void AreNotEqualIteratesOverTheEntireFile()
		{
			using(TestFile tf1 = new TestFile("Test1.txt","NUnit.Framework.Tests.TestText1.txt"))
			{
				using(TestFile tf2 = new TestFile("Test2.txt","NUnit.Framework.Tests.TestText2.txt"))
				{
					FileAssert.AreNotEqual( "Test1.txt", "Test2.txt" );
				}
			}
		}
开发者ID:taoxiease,项目名称:asegrp,代码行数:10,代码来源:FileAssertTests.cs

示例13: AreNotEqualPassesWithFileInfos

		public void AreNotEqualPassesWithFileInfos()
		{
			using(TestFile tf1 = new TestFile("Test1.jpg","NUnit.Framework.Tests.TestImage1.jpg"))
			{
				using(TestFile tf2 = new TestFile("Test2.jpg","NUnit.Framework.Tests.TestImage2.jpg"))
				{
					FileInfo expected = new FileInfo( "Test1.jpg" );
					FileInfo actual = new FileInfo( "Test2.jpg" );
					FileAssert.AreNotEqual( expected, actual );
				}
			}
		}
开发者ID:taoxiease,项目名称:asegrp,代码行数:12,代码来源:FileAssertTests.cs

示例14: AreNotEqualPassesWithFiles

		public void AreNotEqualPassesWithFiles()
		{
			using(TestFile tf1 = new TestFile("Test1.jpg","NUnit.Framework.Tests.TestImage1.jpg"))
			{
				using(TestFile tf2 = new TestFile("Test2.jpg","NUnit.Framework.Tests.TestImage2.jpg"))
				{
					FileAssert.AreNotEqual( "Test1.jpg", "Test2.jpg" );
				}
			}
		}
开发者ID:taoxiease,项目名称:asegrp,代码行数:10,代码来源:FileAssertTests.cs

示例15: AreEqualFailsWithTextFilesAfterReadingBothFiles

		public void AreEqualFailsWithTextFilesAfterReadingBothFiles()
		{
            using (TestFile tf1 = new TestFile("Test1.txt", "TestText1.txt"))
			{
                using (TestFile tf2 = new TestFile("Test2.txt", "TestText2.txt"))
				{
					FileAssert.AreEqual( tf1.FileName, tf2.FileName );
				}
			}
		}
开发者ID:rmterra,项目名称:AutoTest.Net,代码行数:10,代码来源:FileAssertTests.cs


注:本文中的NUnit.Framework.Tests.TestFile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。