本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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);
}