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


C# NUnit.Framework类代码示例

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


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

示例1: Detect_multiple_anagrams

 public void Detect_multiple_anagrams()
 {
     var detector = new Anagram("master");
     var words = new[] { "stream", "pigeon", "maters" };
     var results = new[] { "maters", "stream" };
     Assert.That(detector.Match(words), Is.EquivalentTo(results));
 }
开发者ID:Zero-man,项目名称:exercism,代码行数:7,代码来源:AnagramTest.cs

示例2: ItOnlyReturnsTriggeredBundles

        public void ItOnlyReturnsTriggeredBundles()
        {
            var collection = new TriggerCollection();

            var bundles = new[]
            {
                new TriggerBundle(TriggerTestHelpers.StaticTrigger(true)),
                new TriggerBundle(TriggerTestHelpers.StaticTrigger(false)),
                new TriggerBundle(TriggerTestHelpers.StaticTrigger(true)),
                new TriggerBundle(TriggerTestHelpers.StaticTrigger(false)),
                new TriggerBundle(TriggerTestHelpers.StaticTrigger(false))
            };

            var expected = new[]
            {
                bundles[0],
                bundles[2],
            };

            foreach(var bundle in bundles)
            {
                collection.Add(bundle);
            }

            var actual = collection.Check();

            CollectionAssert.AreEqual(expected, actual);
        }
开发者ID:Mavtak,项目名称:roomie,代码行数:28,代码来源:TriggerCollectionTests.cs

示例3: ShouldInsertPeoples

        public void ShouldInsertPeoples()
        {
            // Given
            var db = new DataBaseMicrosoft(DataBasesTypes.MicrosoftAccess, TestHelper.CreateTempFile());
            var peoples = new[]
            {
                new People("Акакий", "Программист"),
                new People("Генка", "Плотник")
            };
            var expected = new[]
            {
                new People("Иванов Иван", "Плотник"),
                new People("Князь Владимир", "Программист"),
                new People("Петров Петр", "Плотник"),
                new People("Клинт Бартон", "Программист"),
                new People("Акакий", "Программист"),
                new People("Генка", "Плотник")
            };

            // When
            foreach (var people in peoples)
            {
                db.ExecuteCommand(Parameters.Insert, people);
            }
            var actual = db.GetElements<People>();
            TestHelper.DeleteTemp();

            // Then
            Assert.AreEqual(expected.Length, actual.Length);
            Assert.IsInstanceOf<People>(actual[0]);
            CollectionAssert.AreEqual(expected, actual);
        }
开发者ID:sunriselink,项目名称:OLAProject,代码行数:32,代码来源:PeopleTests.cs

示例4: Should_Return_False_For_PropertyInfo_Objects_With_Different_Names

 public void Should_Return_False_For_PropertyInfo_Objects_With_Different_Names()
 {
     var type = new { Prop1 = 10, Prop2 = 20 }.GetType();
       var propData1 = new PropertyData(type.GetProperties()[0]);
       var propData2 = new PropertyData(type.GetProperties()[1]);
       Assert.IsFalse(propData1.Equals(propData2));
 }
开发者ID:jbrechtel,项目名称:plant,代码行数:7,代码来源:PropertyDataTest.cs

示例5: Can_campaignTemplateContent

        public void Can_campaignTemplateContent()
        {
            var args = new { cid = "9349a04e77" };
            var templateContentResponse = tree.Do(x => x.Campaign.campaignTemplateContent(args));

            Assert.True(templateContentResponse.Success);
        }
开发者ID:ChrisMissal,项目名称:Freddie,代码行数:7,代码来源:CampaignTests.cs

示例6: MergeSortTestWithNegativeNumbers

 public void MergeSortTestWithNegativeNumbers()
 {
     var input = new[] { 2, 3, 1, -7, 4, 9 };
     var expected = new[] { -7, 1, 2, 3, 4, 9 };
     SortingProblems.MergeSort(input);
     CollectionAssert.AreEqual(expected, input);
 }
开发者ID:adilmughal,项目名称:Algorithms-and-Programming-Problems,代码行数:7,代码来源:SortingProblemsTest.cs

示例7: Cmasp_Do

        public void Cmasp_Do()
        {
            var addr = Address.SegPtr(0x0C20, 0);
            var proc = new Procedure("foo", null);
            var progaddr = new ProgramAddress(program, addr);
            var dc = mr.Stub<IDecompiler>();
            var dcSvc = mr.Stub<IDecompilerService>();
            var brSvc = mr.Stub<IProjectBrowserService>();
            dcSvc.Decompiler = dc;
            sc.AddService<IDecompilerService>(dcSvc);
            sc.AddService<IProjectBrowserService>(brSvc);
            sc.AddService<IDecompilerShellUiService>(new FakeShellUiService());
            dc.Expect(d => d.ScanProcedure(progaddr)).IgnoreArguments().Return(proc);
            brSvc.Expect(b => b.Reload());
            mr.ReplayAll();

            var locations = new[] { new ProgramAddress(program, addr) };
            var cmd = new Cmd_MarkProcedures(sc, locations);
            cmd.DoIt();

            mr.VerifyAll();
            Assert.AreEqual(1, program.User.Procedures.Count);
            var uproc = program.User.Procedures.Values[0];
            Assert.AreEqual("0C20:0000", uproc.Address);
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:25,代码来源:Cmd_MarkProcedureTests.cs

示例8: Anagrams_are_case_insensitive

 public void Anagrams_are_case_insensitive()
 {
     var detector = new Anagram("Orchestra");
     var words = new[] { "cashregister", "Carthorse", "radishes" };
     var results = new[] { "Carthorse" };
     Assert.That(detector.Match(words), Is.EquivalentTo(results));
 }
开发者ID:Zero-man,项目名称:exercism,代码行数:7,代码来源:AnagramTest.cs

示例9: No_matches

 public void No_matches()
 {
     var detector = new Anagram("diaper");
     var words = new[] { "hello", "world", "zombies", "pants" };
     var results = new string[0];
     Assert.That(detector.Match(words), Is.EquivalentTo(results));
 }
开发者ID:Zero-man,项目名称:exercism,代码行数:7,代码来源:AnagramTest.cs

示例10: Eliminate_anagram_subsets

 public void Eliminate_anagram_subsets()
 {
     var detector = new Anagram("good");
     var words = new[] { "dog", "goody" };
     var results = new string[0];
     Assert.That(detector.Match(words), Is.EquivalentTo(results));
 }
开发者ID:Zero-man,项目名称:exercism,代码行数:7,代码来源:AnagramTest.cs

示例11: Identical_word_is_not_anagram

 public void Identical_word_is_not_anagram()
 {
     var detector = new Anagram("corn");
     var words = new[] { "corn", "dark", "Corn", "rank", "CORN", "cron", "park" };
     var results = new[] { "cron" };
     Assert.That(detector.Match(words), Is.EquivalentTo(results));
 }
开发者ID:Zero-man,项目名称:exercism,代码行数:7,代码来源:AnagramTest.cs

示例12: Eliminate_anagrams_with_same_checksum

 public void Eliminate_anagrams_with_same_checksum()
 {
     var detector = new Anagram("mass");
     var words = new[] { "last" };
     var results = new string[0];
     Assert.That(detector.Match(words), Is.EquivalentTo(results));
 }
开发者ID:Zero-man,项目名称:exercism,代码行数:7,代码来源:AnagramTest.cs

示例13: Does_not_confuse_different_duplicates

 public void Does_not_confuse_different_duplicates()
 {
     var detector = new Anagram("galea");
     var words = new[] { "eagle" };
     var results = new string[0];
     Assert.That(detector.Match(words), Is.EquivalentTo(results));
 }
开发者ID:Zero-man,项目名称:exercism,代码行数:7,代码来源:AnagramTest.cs

示例14: Detect_simple_anagram

 public void Detect_simple_anagram()
 {
     var detector = new Anagram("ant");
     var words = new[] { "tan", "stand", "at" };
     var results = new[] { "tan" };
     Assert.That(detector.Match(words), Is.EquivalentTo(results));
 }
开发者ID:Zero-man,项目名称:exercism,代码行数:7,代码来源:AnagramTest.cs

示例15: InsertionSortTestWithNegativeNumbers

 public void InsertionSortTestWithNegativeNumbers()
 {
     var input = new[] { 2, 3, 1, -7, 4, 9 };
     var expected = new[] { -7, 1, 2, 3, 4, 9 };
     int[] actual = SortingProblems.InsertionSort(input);
     CollectionAssert.AreEqual(expected, actual);
 }
开发者ID:adilmughal,项目名称:Algorithms-and-Programming-Problems,代码行数:7,代码来源:SortingProblemsTest.cs


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