NUnit.Framework.Is.EqualTo(object)

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 7

1. Example

Project: ContinuousTests
Source File: EqualityTests.cs
View license
[SetUp]
        public void SetUp()
        {
            parseTree = "<equal 999>";
            staticSyntax = Is.EqualTo(999);
            inheritedSyntax = Helper().EqualTo(999);
            builderSyntax = Builder().EqualTo(999);
        }

2. Example

Project: ContinuousTests
Source File: EqualityTests.cs
View license
[SetUp]
        public void SetUp()
        {
            parseTree = @"<equal ""X"">";
            staticSyntax = Is.EqualTo("X").IgnoreCase;
            inheritedSyntax = Helper().EqualTo("X").IgnoreCase;
            builderSyntax = Builder().EqualTo("X").IgnoreCase;
        }

3. Example

Project: ContinuousTests
Source File: EqualityTests.cs
View license
[SetUp]
        public void SetUp()
        {
            parseTree = "<equal 999>";
            staticSyntax = Is.EqualTo(999);
            inheritedSyntax = Helper().EqualTo(999);
            builderSyntax = Builder().EqualTo(999);
        }

4. Example

Project: ContinuousTests
Source File: EqualityTests.cs
View license
[SetUp]
        public void SetUp()
        {
            parseTree = @"<equal ""X"">";
            staticSyntax = Is.EqualTo("X").IgnoreCase;
            inheritedSyntax = Helper().EqualTo("X").IgnoreCase;
            builderSyntax = Builder().EqualTo("X").IgnoreCase;
        }

5. Example

Project: ContinuousTests
Source File: EqualityTests.cs
View license
[SetUp]
        public void SetUp()
        {
            parseTree = "<equal 999>";
            staticSyntax = Is.EqualTo(999);
            inheritedSyntax = Helper().EqualTo(999);
            builderSyntax = Builder().EqualTo(999);
        }

6. Example

Project: ContinuousTests
Source File: EqualityTests.cs
View license
[SetUp]
        public void SetUp()
        {
            parseTree = @"<equal ""X"">";
            staticSyntax = Is.EqualTo("X").IgnoreCase;
            inheritedSyntax = Helper().EqualTo("X").IgnoreCase;
            builderSyntax = Builder().EqualTo("X").IgnoreCase;
        }

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"));
        }

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"));
        }

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"));
        }

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"));
        }

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"));
        }

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"));
        }

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"));
        }

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"));
        }

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"));
        }

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"));
        }

17. Example

Project: devicehive-.net
Source File: AuthTest.cs
View license
[Test]
        public void BadRequest()
        {
            Expect(Client.Post("/auth/accesskey", new { }).Status, Is.EqualTo(400)); // missing provider name
        }

18. Example

Project: devicehive-.net
Source File: AuthTest.cs
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));
        }

19. Example

Project: nmoneys
Source File: Must.Extensions.net.cs
View license
public static Constraint XmlDeserializableInto<T>(this Must.BeEntryPoint entryPoint, T to)
		{
			return new DeserializationConstraint<T>(new XmlDeserializer(), NUnit.Framework.Is.EqualTo(to));
		}

20. Example

Project: nmoneys
Source File: Must.Extensions.net.cs
View license
public static Constraint DataContractDeserializableInto<T>(this Must.BeEntryPoint entryPoint, T to)
		{
			return new DeserializationConstraint<T>(new DataContractDeserializer(), NUnit.Framework.Is.EqualTo(to));
		}

21. Example

Project: nmoneys
Source File: Must.Extensions.net.cs
View license
public static Constraint DataContractJsonDeserializableInto<T>(this Must.BeEntryPoint entryPoint, T to)
		{
			return new DeserializationConstraint<T>(new DataContractJsonDeserializer(dataContractSurrogate: new DataContractSurrogate()), NUnit.Framework.Is.EqualTo(to));
		}

22. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void Parse_Defined_UpperCased_AlphabeticCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("USD"), Is.EqualTo(CurrencyIsoCode.USD));
		}

23. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void Parse_Defined_LowerCased_AlphabeticCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("eur"), Is.EqualTo(CurrencyIsoCode.EUR));
		}

24. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void Parse_Defined_MixedCased_AlphabeticCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("NoK"), Is.EqualTo(CurrencyIsoCode.NOK));
		}

25. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void Parse_Defined_NumericCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("999"), Is.EqualTo(CurrencyIsoCode.ttt));
		}

26. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void Parse_Defined_PadedNumericCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("036"), Is.EqualTo(CurrencyIsoCode.AUD));
		}

27. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void DefaultParse_Defined_UpperCased_AlphabeticCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("USD", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.USD));
		}

28. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void DefaultParse_Defined_LowerCased_AlphabeticCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("eur", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.EUR));
		}

29. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void DefaultParse_Defined_MixedCased_AlphabeticCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("NoK", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.NOK));
		}

30. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void DefaultParse_Defined_NumericCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("999", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.ttt));
		}

31. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void DefaultParse_Defined_PadedNumericCode_CodeParsed()
		{
			Assert.That(Currency.Code.Parse("036", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.AUD));
		}

32. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void DefaultParse_Null_Exception()
		{
			Assert.That(() => Currency.Code.Parse(null, CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.XTS));
		}

33. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void DefaultParse_Undefined_AlphabeticCode_Default()
		{
			Assert.That(() => Currency.Code.Parse("notAnIsoCode", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.XTS));
		}

34. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void DefaultParse_Undefined_NumericCode_Default()
		{
			Assert.That(() => Currency.Code.Parse("0", CurrencyIsoCode.XTS), Is.EqualTo(CurrencyIsoCode.XTS));
		}

35. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
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));

		}

36. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
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));
		}

37. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
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));
		}

38. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
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));
		}

39. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
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));
		}

40. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
View license
[Test]
		public void Cast_Defined_CastedIsoCode()
		{
			Assert.That(Currency.Code.Cast(36), Is.EqualTo(CurrencyIsoCode.AUD));
		}

41. Example

Project: nmoneys
Source File: CurrencyTester.Code.cs
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));
		}

42. Example

Project: nmoneys
Source File: MoneyTester.cs
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));
		}

43. Example

Project: nmoneys
Source File: MoneyTester.cs
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));
		}

44. Example

Project: nmoneys
Source File: MoneyTester.cs
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));
		}

45. Example

Project: nmoneys
Source File: MoneyTester.cs
View license
[Test]
		public void Ctor_Currency_PropertiesSet()
		{
			Assert.That(tenner.Amount, Is.EqualTo(10m));
			Assert.That(tenner.CurrencyCode, Is.EqualTo(CurrencyIsoCode.GBP));
		}

46. Example

Project: nmoneys
Source File: MoneyTester.cs
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));
		}

47. Example

Project: nmoneys
Source File: MoneyTester.cs
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));
		}

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));
		}

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));
		}

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"));
		}