Here are the examples of the csharp api class NUnit.Framework.Is.EqualTo(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 license[SetUp] public void SetUp() { parseTree = "<equal 999>"; staticSyntax = Is.EqualTo(999); inheritedSyntax = Helper().EqualTo(999); builderSyntax = Builder().EqualTo(999); }
0
2. Example
View license[SetUp] public void SetUp() { parseTree = @"<equal ""X"">"; staticSyntax = Is.EqualTo("X").IgnoreCase; inheritedSyntax = Helper().EqualTo("X").IgnoreCase; builderSyntax = Builder().EqualTo("X").IgnoreCase; }
0
3. Example
View license[SetUp] public void SetUp() { parseTree = "<equal 999>"; staticSyntax = Is.EqualTo(999); inheritedSyntax = Helper().EqualTo(999); builderSyntax = Builder().EqualTo(999); }
0
4. Example
View license[SetUp] public void SetUp() { parseTree = @"<equal ""X"">"; staticSyntax = Is.EqualTo("X").IgnoreCase; inheritedSyntax = Helper().EqualTo("X").IgnoreCase; builderSyntax = Builder().EqualTo("X").IgnoreCase; }
0
5. Example
View license[SetUp] public void SetUp() { parseTree = "<equal 999>"; staticSyntax = Is.EqualTo(999); inheritedSyntax = Helper().EqualTo(999); builderSyntax = Builder().EqualTo(999); }
0
6. Example
View license[SetUp] public void SetUp() { parseTree = @"<equal ""X"">"; staticSyntax = Is.EqualTo("X").IgnoreCase; inheritedSyntax = Helper().EqualTo("X").IgnoreCase; builderSyntax = Builder().EqualTo("X").IgnoreCase; }
0
7. Example
View license[Test] public void Should_get_plugins() { Assert.That(_parser.Plugins.Count(), Is.EqualTo(2)); Assert.That(_parser.Plugins.ElementAt(0).Assembly, Is.EqualTo(@"C:\Some\Path\Assembly.dll")); Assert.That(_parser.Plugins.ElementAt(0).Type, Is.EqualTo("This.Is.Full.Type.Name.For.Class.Implementing.IAutoTestNetTestRunner")); Assert.That(_parser.Plugins.ElementAt(1).Assembly, Is.EqualTo(@"C:\Some\Path\Assembly.dll")); Assert.That(_parser.Plugins.ElementAt(1).Type, Is.EqualTo("Some.Class.Name")); }
0
8. Example
View license[Test] public void Should_get_runners() { Assert.That(_parser.Options.TestRuns.Count(), Is.EqualTo(2)); Assert.That(_parser.Options.TestRuns.ElementAt(0).ID, Is.EqualTo("nunit")); Assert.That(_parser.Options.TestRuns.ElementAt(1).ID, Is.EqualTo("another")); }
0
9. Example
View license[Test] public void Should_get_categories() { Assert.That(_parser.Options.TestRuns.ElementAt(0).Categories.Count(), Is.EqualTo(2)); Assert.That(_parser.Options.TestRuns.ElementAt(0).Categories.ElementAt(0), Is.EqualTo("SomeTestCategory")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Categories.ElementAt(1), Is.EqualTo("SomeOtherTestCategory")); }
0
10. Example
View license[Test] public void Should_get_assemblies() { Assert.That(_parser.Options.TestRuns.Count(), Is.EqualTo(2)); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.Count(), Is.EqualTo(4)); Assert.That(_parser.Options.TestRuns.ElementAt(1).Assemblies.Count(), Is.EqualTo(1)); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Assembly, Is.EqualTo(@"C:\my\testassembly.dll")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).IsVerified, Is.True); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(1).Assembly, Is.EqualTo(@"C:\my\testassembly.dll")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(1).IsVerified, Is.False); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(2).Assembly, Is.EqualTo(@"C:\my\anothernunitassembly.dll")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(2).IsVerified, Is.False); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(3).Assembly, Is.EqualTo(@"C:\my\testassembly.dll")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(3).IsVerified, Is.False); Assert.That(_parser.Options.TestRuns.ElementAt(1).Assemblies.ElementAt(0).Assembly, Is.EqualTo(@"C:\my\other\testassembly.dll")); }
0
11. Example
View license[Test] public void Should_get_tests() { Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Tests.Count(), Is.EqualTo(2)); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Tests.ElementAt(0), Is.EqualTo("testassembly.class.test1")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Tests.ElementAt(1), Is.EqualTo("testassembly.class.test2")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(1).Tests.ElementAt(0), Is.EqualTo("testassembly.class.test3")); }
0
12. Example
View license[Test] public void Should_get_members() { Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Members.Count(), Is.EqualTo(2)); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Members.ElementAt(0), Is.EqualTo("testassembly.class2")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Members.ElementAt(1), Is.EqualTo("testassembly.class3")); }
0
13. Example
View license[Test] public void Should_get_namespaces() { Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Namespaces.Count(), Is.EqualTo(2)); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Namespaces.ElementAt(0), Is.EqualTo("testassembly.somenamespace1")); Assert.That(_parser.Options.TestRuns.ElementAt(0).Assemblies.ElementAt(0).Namespaces.ElementAt(1), Is.EqualTo("testassembly.somenamespace2")); }
0
14. Example
View license[Test] public void Should_parse_input_file() { var parser = new ArgumentParser(new string[] { "--input=\"C:\\somewhere\\something.meh\"" }); var arguments = parser.Parse(); Assert.That(arguments.InputFile, Is.EqualTo("C:\\somewhere\\something.meh")); }
0
15. Example
View license[Test] public void Should_parse_output_file() { var parser = new ArgumentParser(new string[] { "--output=\"C:\\somewhere\\something.meh\"" }); var arguments = parser.Parse(); Assert.That(arguments.OutputFile, Is.EqualTo("C:\\somewhere\\something.meh")); }
0
16. Example
View license[Test] public void Should_parse_channel() { var parser = new ArgumentParser(new string[] { "--channel=\"Some Channel\"" }); var arguments = parser.Parse(); Assert.That(arguments.Channel, Is.EqualTo("Some Channel")); }
0
17. Example
View license[Test] public void BadRequest() { Expect(Client.Post("/auth/accesskey", new { }).Status, Is.EqualTo(400)); // missing provider name }
0
18. Example
View license[Test] public void Unauthorized() { // create access key Expect(Client.Post("/auth/accesskey", new { providerName = "nonexist" }).Status, Is.EqualTo(401)); // non-supported or disabled provider Expect(Client.Post("/auth/accesskey", new { providerName = "password", login = "xx", password = "xx" }).Status, Is.EqualTo(401)); // delete access key Expect(Client.Delete("/auth/accesskey").Status, Is.EqualTo(401)); }
0
19. Example
View licensepublic static Constraint XmlDeserializableInto<T>(this Must.BeEntryPoint entryPoint, T to) { return new DeserializationConstraint<T>(new XmlDeserializer(), NUnit.Framework.Is.EqualTo(to)); }
0
20. Example
View licensepublic static Constraint DataContractDeserializableInto<T>(this Must.BeEntryPoint entryPoint, T to) { return new DeserializationConstraint<T>(new DataContractDeserializer(), NUnit.Framework.Is.EqualTo(to)); }
0
21. Example
View licensepublic static Constraint DataContractJsonDeserializableInto<T>(this Must.BeEntryPoint entryPoint, T to) { return new DeserializationConstraint<T>(new DataContractJsonDeserializer(dataContractSurrogate: new DataContractSurrogate()), NUnit.Framework.Is.EqualTo(to)); }
0
22. Example
View license[Test] public void Parse_Defined_UpperCased_AlphabeticCode_CodeParsed() { Assert.That(Currency.Code.Parse("USD"), Is.EqualTo(CurrencyIsoCode.USD)); }
0
23. Example
View license[Test] public void Parse_Defined_LowerCased_AlphabeticCode_CodeParsed() { Assert.That(Currency.Code.Parse("eur"), Is.EqualTo(CurrencyIsoCode.EUR)); }
0
24. Example
View license[Test] public void Parse_Defined_MixedCased_AlphabeticCode_CodeParsed() { Assert.That(Currency.Code.Parse("NoK"), Is.EqualTo(CurrencyIsoCode.NOK)); }
0
25. Example
View license[Test] public void Parse_Defined_NumericCode_CodeParsed() { Assert.That(Currency.Code.Parse("999"), Is.EqualTo(CurrencyIsoCode.ttt)); }
0
26. Example
View license[Test] public void Parse_Defined_PadedNumericCode_CodeParsed() { Assert.That(Currency.Code.Parse("036"), Is.EqualTo(CurrencyIsoCode.AUD)); }
0
27. Example
View license[Test] public void DefaultParse_Defined_UpperCased_AlphabeticCode_CodeParsed() { Assert.That(Currency.Code.Parse("USD", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.USD)); }
0
28. Example
View license[Test] public void DefaultParse_Defined_LowerCased_AlphabeticCode_CodeParsed() { Assert.That(Currency.Code.Parse("eur", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.EUR)); }
0
29. Example
View license[Test] public void DefaultParse_Defined_MixedCased_AlphabeticCode_CodeParsed() { Assert.That(Currency.Code.Parse("NoK", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.NOK)); }
0
30. Example
View license[Test] public void DefaultParse_Defined_NumericCode_CodeParsed() { Assert.That(Currency.Code.Parse("999", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.ttt)); }
0
31. Example
View license[Test] public void DefaultParse_Defined_PadedNumericCode_CodeParsed() { Assert.That(Currency.Code.Parse("036", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.AUD)); }
0
32. Example
View license[Test] public void DefaultParse_Null_Exception() { Assert.That(() => Currency.Code.Parse(null, CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.XTS)); }
0
33. Example
View license[Test] public void DefaultParse_Undefined_AlphabeticCode_Default() { Assert.That(() => Currency.Code.Parse("notAnIsoCode", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.XTS)); }
0
34. Example
View license[Test] public void DefaultParse_Undefined_NumericCode_Default() { Assert.That(() => Currency.Code.Parse("0", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.XTS)); }
0
35. Example
View license[Test] public void TryParse_Defined_UpperCased_AlphabeticCode_CodeParsed() { CurrencyIsoCode? parsed; Assert.That(Currency.Code.TryParse("USD", out parsed), Is.True); Assert.That(parsed, Is.EqualTo(CurrencyIsoCode.USD)); }
0
36. Example
View license[Test] public void TryParse_Defined_LowerCased_AlphabeticCode_CodeParsed() { CurrencyIsoCode? parsed; Assert.That(Currency.Code.TryParse("eur", out parsed), Is.True); Assert.That(parsed, Is.EqualTo(CurrencyIsoCode.EUR)); }
0
37. Example
View license[Test] public void TryParse_Defined_MixedCased_AlphabeticCode_CodeParsed() { CurrencyIsoCode? parsed; Assert.That(Currency.Code.TryParse("NoK", out parsed), Is.True); Assert.That(parsed, Is.EqualTo(CurrencyIsoCode.NOK)); }
0
38. Example
View license[Test] public void TryParse_Defined_NumericCode_CodeParsed() { CurrencyIsoCode? parsed; Assert.That(Currency.Code.TryParse("999", out parsed), Is.True); Assert.That(parsed, Is.EqualTo(CurrencyIsoCode.ttt)); }
0
39. Example
View license[Test] public void TryParse_Defined_PaddedNumericCode_CodeParsed() { CurrencyIsoCode? parsed; Assert.That(Currency.Code.TryParse("036", out parsed), Is.True); Assert.That(parsed, Is.EqualTo(CurrencyIsoCode.AUD)); }
0
40. Example
View license[Test] public void Cast_Defined_CastedIsoCode() { Assert.That(Currency.Code.Cast(36), Is.EqualTo(CurrencyIsoCode.AUD)); }
0
41. Example
View license[Test] public void TryCast_DefinedValue_CastedIsoCode() { CurrencyIsoCode? casted; Assert.That(Currency.Code.TryCast(36, out casted), Is.True); Assert.That(casted, Is.EqualTo(CurrencyIsoCode.AUD)); }
0
42. Example
View license[Test] public void Ctor_Amount_AmountWithNoneCurrency() { Money defaultMoney = new Money(3m); Assert.That(defaultMoney.Amount, Is.EqualTo(3m)); Assert.That(defaultMoney.CurrencyCode, Is.EqualTo(CurrencyIsoCode.ttt)); }
0
43. Example
View license[Test] public void Ctor_ExistingIsoCode_PropertiesSet() { Money tenDollars = new Money(10, CurrencyIsoCode.USD); Assert.That(tenDollars.Amount, Is.EqualTo(10m)); Assert.That(tenDollars.CurrencyCode, Is.EqualTo(CurrencyIsoCode.USD)); }
0
44. Example
View license[Test] public void Ctor_ExistingIsoSymbol_PropertiesSet() { Money hundredLerus = new Money(100, "EUR"); Assert.That(hundredLerus.Amount, Is.EqualTo(100m)); Assert.That(hundredLerus.CurrencyCode, Is.EqualTo(CurrencyIsoCode.EUR)); }
0
45. Example
View license[Test] public void Ctor_Currency_PropertiesSet() { Assert.That(tenner.Amount, Is.EqualTo(10m)); Assert.That(tenner.CurrencyCode, Is.EqualTo(CurrencyIsoCode.GBP)); }
0
46. Example
View license[Test] public void CurrencyDependentMethod_CanBeUsedWithDefaultInstance() { Money @default = new Money(); Assert.That(() => @default.ToString(), Throws.Nothing); Assert.That(@default.CurrencyCode, Is.EqualTo(CurrencyIsoCode.ttt)); }
0
47. Example
View license[Test] public void ctor_IsoCode_IsCaseInsensitive() { var upper = new Money(100, "EUR"); var mixed = new Money(100, "eUr"); Assert.That(upper, Is.EqualTo(mixed)); }
0
48. Example
View license[Test] public void Test_Capacity_Is_Rounded_Up() { // default capacity is 4 levels, for 31 items max var cola = new ColaOrderedSet<string>(); Assert.That(cola.Capacity, Is.EqualTo(31)); // 63 items completely fill 5 levels cola = new ColaOrderedSet<string>(63); Assert.That(cola.Capacity, Is.EqualTo(63)); // 64 items need 6 levels, which can hold up to 127 items cola = new ColaOrderedSet<string>(64); Assert.That(cola.Capacity, Is.EqualTo(127)); }
0
49. Example
View license[Test] public void Test_ColaOrderedSet_Add() { var cola = new ColaOrderedSet<int?>(); Assert.That(cola.Count, Is.EqualTo(0)); cola.Add(42); cola.Debug_Dump(); Assert.That(cola.Count, Is.EqualTo(1)); Assert.That(cola.Contains(42), Is.True); cola.Add(1); cola.Debug_Dump(); Assert.That(cola.Count, Is.EqualTo(2)); Assert.That(cola.Contains(1), Is.True); cola.Add(66); cola.Debug_Dump(); Assert.That(cola.Count, Is.EqualTo(3)); Assert.That(cola.Contains(66), Is.True); cola.Add(123); cola.Debug_Dump(); Assert.That(cola.Count, Is.EqualTo(4)); Assert.That(cola.Contains(123), Is.True); cola.Add(-77); cola.Add(-76); cola.Add(-75); cola.Add(-74); cola.Add(-73); cola.Debug_Dump(); Assert.That(cola.Count, Is.EqualTo(9)); }
0
50. Example
View license[Test] public void Test_RangeDictionary_Insert_Single() { var cola = new ColaRangeDictionary<int, string>(); Assert.That(cola.Count, Is.EqualTo(0)); cola.Mark(0, 1, "A"); Assert.That(cola.Count, Is.EqualTo(1)); var items = cola.ToArray(); Assert.That(items.Length, Is.EqualTo(1)); Assert.That(items[0].Begin, Is.EqualTo(0)); Assert.That(items[0].End, Is.EqualTo(1)); Assert.That(items[0].Value, Is.EqualTo("A")); }