NUnit.Framework.Assert.AreEqual(object, object)

Here are the examples of the csharp api class NUnit.Framework.Assert.AreEqual(object, 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: duality
Source File: TransformTest.cs
View license
[Test] public void CommitChangesPropagation()
		{
			// Create a linear transform hierarchy from roo/n ..... /n //View Source file for more details /n }

2. Example

Project: duality
Source File: TargetResizeTest.cs
View license
[Test] public void Stretch()
		{
			Assert.AreEqual(new Vector2(3, 5), TargetResize.Stretch.Apply(new Vector2(0, 0), new Vector2(3, 5)));
			Assert.AreEqual(new Vector2(0, 0), TargetResize.Stretch.Apply(new Vector2(1, 1), new Vector2(0, 0)));
			Assert.AreEqual(new Vector2(3, 5), TargetResize.Stretch.Apply(new Vector2(1, 1), new Vector2(3, 5)));
			Assert.AreEqual(new Vector2(3, 5), TargetResize.Stretch.Apply(new Vector2(1, 2), new Vector2(3, 5)));
			Assert.AreEqual(new Vector2(3, 5), TargetResize.Stretch.Apply(new Vector2(2, 1), new Vector2(3, 5)));
		}

3. Example

Project: duality
Source File: GenericOperatorTest.cs
View license
[Test] public void LogicalOperation()
		{
			Assert.AreEqual(0x0123456 & 0x654321, GenericOperator.And(0x0123456, 0x654321));
			Assert.AreEqual(0x0123456 | 0x654321, GenericOperator.Or(0x0123456, 0x654321));
			Assert.AreEqual(0x0123456 ^ 0x654321, GenericOperator.Xor(0x0123456, 0x654321));
			Assert.AreEqual(~0x0123456, GenericOperator.Not(0x0123456));
		}

4. Example

Project: duality
Source File: GenericOperatorTest.cs
View license
[Test] public void ColorRgbaMath()
		{
			Assert.AreEqual(
				ColorRgba.Red + ColorRgba.Blue,
				GenericOperator.Add(ColorRgba.Red, ColorRgba.Blue));
			Assert.AreEqual(
				ColorRgba.Red - ColorRgba.Blue,
				GenericOperator.Subtract(ColorRgba.Red, ColorRgba.Blue));
			Assert.AreEqual(
				ColorRgba.Red * ColorRgba.Blue,
				GenericOperator.Multiply(ColorRgba.Red, ColorRgba.Blue));

			Assert.AreEqual(
				ColorRgba.Red == ColorRgba.Blue,
				GenericOperator.Equal(ColorRgba.Red, ColorRgba.Blue));
			#pragma warning disable 1718
			Assert.AreEqual(
				ColorRgba.Red == ColorRgba.Red,
				GenericOperator.Equal(ColorRgba.Red, ColorRgba.Red));
		}

5. Example

View license
[Test] public void BasicFunctionality()
		{
			ComponentExecutionOrder order = new ComponentExecutionOrder();

			int sortIndexA1 = order.GetSortIndex(typeof(TestComponentA1));
			int sortIndexA2 = order.GetSortIndex(typeof(TestComponentA2));

			// Expect no particular order, but consistent results
			Assert.AreEqual(sortIndexA1, order.GetSortIndex(typeof(TestComponentA1)));
			Assert.AreEqual(sortIndexA2, order.GetSortIndex(typeof(TestComponentA2)));

			// Expect that clearing the type cache does not change any results
			order.ClearTypeCache();
			Assert.AreEqual(sortIndexA1, order.GetSortIndex(typeof(TestComponentA1)));
			Assert.AreEqual(sortIndexA2, order.GetSortIndex(typeof(TestComponentA2)));
		}

6. Example

View license
[Test]
		public void ShouldHaveEDBFileWatchWithNetworkAreasAttribute()
		{
			Assert.AreEqual("DMZ|APP", _LogSearchShipper.EDBFileWatchers[1].NetworkAreas);
		}

7. Example

View license
[Test]
		public void ShouldHaveEDBFileWatchWithServiceNamesAttribute()
		{
			Assert.AreEqual("nolio.*", _LogSearchShipper.EDBFileWatchers[1].ServiceNames);
		}

8. Example

View license
[Test]
		public void ShouldHaveIngestorHostAttribute()
		{
			Assert.AreEqual("ingestor.example.com", _LogSearchShipper.IngestorHost);
		}

9. Example

View license
[Test]
		public void ShouldHaveIngestorPortAttribute()
		{
			Assert.AreEqual(443, _LogSearchShipper.IngestorPort);
		}

10. Example

View license
[Test]
		public void ShouldHaveFileWatchWithFieldsWithKeyAndValue()
		{
			Assert.AreEqual("field1", _LogSearchShipper.FileWatchers[0].Fields[0].Key);
			Assert.AreEqual("field1 value", _LogSearchShipper.FileWatchers[0].Fields[0].Value);
		}

11. Example

View license
[Test]
		public void ShouldHaveEDBFileWatchWithFieldsWithKeyAndValue()
		{
			Assert.AreEqual("edb_key/subkey", _LogSearchShipper.EDBFileWatchers[0].Fields[0].Key);
			Assert.AreEqual("edb_value/subvalue", _LogSearchShipper.EDBFileWatchers[0].Fields[0].Value);
		}

12. Example

View license
[Test]
		public void ShouldHaveFileWatchWithTypeAttribute()
		{
			Assert.AreEqual("myfile_type", _LogSearchShipper.FileWatchers[0].Type);
		}

13. Example

View license
[Test]
		public void ShouldHaveEDBFileWatchWithDataFileAttribute()
		{
			Assert.AreEqual(@"SampleData\EDB\ENV1\Latest.xml", _LogSearchShipper.EDBFileWatchers[0].DataFile);
		}

14. Example

View license
[Test]
		public void ShouldHaveEDBFileWatchWithServerNamesAttribute()
		{
			Assert.AreEqual("(.*01|.*02)", _LogSearchShipper.EDBFileWatchers[1].ServerNames);
		}

15. Example

View license
[Test]
		public void ShouldHaveEDBFileWatchWithLogEnvironmentDiagramDataEveryMinutes()
		{
			Assert.AreEqual(42, _LogSearchShipper.EDBFileWatchers[0].LogEnvironmentDiagramDataEveryMinutes);
		}

16. Example

View license
[Test]
		public void ShouldHaveFileWatchWithFilesAttribute()
		{
			Assert.AreEqual("myfile.log", _LogSearchShipper.FileWatchers[0].Files);
		}

17. Example

Project: CIAPI.CS
Source File: AppKeyFixture.cs
View license
[Test]
        public void AppKeyIsAppendedToLogonRequest()
        {

            var rpcClient = BuildRpcClient();
            rpcClient.LogOut();
            rpcClient.Dispose();

            // while tests can be  written without knowledge of the http transport layer,
            // it is possible for a test to examine, in minute detail, the traffic it has generated.

            var entry = this.TrafficLog.List().First();
            var r = entry.log.entries[0].request;
            var dto = rpcClient.Serializer.DeserializeObject<ApiLogOnRequestDTO>(r.postData.text);
            Assert.AreEqual(ApiKey, dto.AppKey);

        }

18. Example

Project: CIAPI.CS
Source File: WatchListFixture.cs
View license
[Test]
        public void HowToUseWatchLists()
        {

            var rpcClient = BuildRpcClien/n ..... /n //View Source file for more details /n }

19. Example

Project: CIAPI.CS
Source File: PriceHistoryFixture.cs
View license
[Test]
        public void CanGetPriceTicks()
        {
            var rpcClient = BuildRpcClient();

            var response = rpcClient.PriceHistory.GetPriceTicks("71442","10");
            Assert.AreEqual(10, response.PriceTicks.Length);

            
        }

20. Example

Project: CIAPI.CS
Source File: WatchListFixture.cs
View license
[Test]
    public void HowToUseWatchLists()
    {

        var rpcClient = BuildRpcClient();

      /n ..... /n //View Source file for more details /n }

21. Example

Project: CIAPI.CS
Source File: PriceHistoryFixture.cs
View license
[Test]
        public void CanGetPriceTicks()
        {
            var rpcClient = BuildRpcClient("CanGetPriceTicks");

            var response = rpcClient.PriceHistory.GetPriceTicks("400158776", "10");
            Assert.AreEqual(10, response.PriceTicks.Length);


        }

22. Example

Project: CIAPI.CS
Source File: PriceHistoryFixture.cs
View license
[Test]
        public void CanGetPriceTicks()
        {
            var rpcClient = BuildRpcClient();

            var response = rpcClient.PriceHistory.GetPriceTicks("400158776", "10");
            Assert.AreEqual(10, response.PriceTicks.Length);


        }

23. Example

View license
[Test]
        public void CreateStringWithValuesOfEachPublicProperty()
        {
            var dto = new TheDto
                          {
                              AnInt = 12,
                              AString = "No place like 127.0.0.1",
                              ADate = new DateTime(2011, 02, 03, 13, 24, 45, 111),
                              ABool = false
                          };
            Assert.AreEqual(@"{""AnInt"":12,""AString"":""No place like 127.0.0.1"",""ADate"":""2011-02-03T13:24:45.111"",""ABool"":false}", dto.ToStringWithValues());
        }

24. Example

Project: CIAPI.CS
Source File: AppKeyFixture.cs
View license
[Test]
        public void AppKeyIsAppendedToLogonRequest()
        {

            var rpcClient = BuildRpcClient("AppKeyIsAppendedToLogonRequest");
            rpcClient.LogOut();
            rpcClient.Dispose();

            // while tests can be  written without knowledge of the http transport layer,
            // it is possible for a test to examine, in minute detail, the traffic it has generated.

            var entry = this.TrafficLog.List().First();
            var r = entry.log.entries[0].request;
            var dto = rpcClient.Serializer.DeserializeObject<ApiLogOnRequestDTO>(r.postData.text);
            Assert.AreEqual(ApiKey, dto.AppKey);

        }

25. Example

Project: CIAPI.CS
Source File: PriceHistoryFixture.cs
View license
[Test]
        public void CanGetPriceBars()
        {
            var rpcClient = BuildRpcClient("CanGetPriceBars");

            var response = rpcClient.PriceHistory.GetPriceBars("400158776", "MINUTE", 10, "10");
            Assert.AreEqual(10, response.PriceBars.Length);

        }

26. Example

Project: CIAPI.CS
Source File: MarketFixture.cs
View license
[Test]
        public void CanListMarketInformation()
        {
            var rpcClient = BuildRpcClient();
            var marketList = GetAvailableCFDMarkets(rpcClient);

            var response = rpcClient.Market.ListMarketInformation(
                new ListMarketInformationRequestDTO
                    { 
                        MarketIds = marketList.ToList().Select(m => m.MarketId).ToArray()
                    }
            );

            Assert.AreEqual(marketList.Length, response.MarketInformation.Length);

            rpcClient.LogOut();
        }

27. Example

Project: CIAPI.CS
Source File: PriceHistoryFixture.cs
View license
[Test]
        public void CanGetPriceBars()
        {
            var rpcClient = BuildRpcClient();

            var response = rpcClient.PriceHistory.GetPriceBars("400158776", "MINUTE", 10, "10");
            Assert.AreEqual(10, response.PriceBars.Length);

        }

28. Example

Project: CIAPI.CS
Source File: WatchListFixture.cs
View license
[Test]
        public void HowToUseWatchLists()
        {

            var rpcClient = BuildRpcClien/n ..... /n //View Source file for more details /n }

29. Example

Project: CIAPI.CS
Source File: PriceHistoryFixture.cs
View license
[Test]
        public void CanGetPriceBars()
        {
            var rpcClient = BuildRpcClient();

            var response = rpcClient.PriceHistory.GetPriceBars("71442", "MINUTE", 10, "10");
            Assert.AreEqual(10, response.PriceBars.Length);

        }

30. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[Test]
        [Category("SodaRequest")]
        public void New_Returns_Request_Using_HTTP_1_1()
        {
            var request = new SodaRequest(exampleUri, "GET", null, null, null);

            Assert.AreEqual(new Version("1.1"), request.webRequest.ProtocolVersion);
        }

31. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[Test]
        [Category("SodaRequest")]
        public void New_GET_With_XML_DataFormat_Sets_Accept_Header()
        {
            var request = new SodaRequest(exampleUri, "GET", null, null, null, SodaDataFormat.XML);

            Assert.AreEqual("application/rdf+xml", request.webRequest.Accept);
        }

32. Example

Project: SODA.NET
Source File: PhoneColumnTest.cs
View license
[Test]
        [Category("PhoneColumn")]
        public void New_Deserializes_PhoneColumn_For_No_Type_Json()
        {
            PhoneColumn phone = new PhoneColumn(jsonPhoneNoType);

            Assert.AreEqual(phoneNumber, phone.PhoneNumber);
            Assert.AreEqual(PhoneColumnType.Undefined, phone.PhoneType);
        }

33. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[TestCase("POST")]
        [TestCase("PUT")]
        [Category("SodaRequest")]
        public void New_POST_PUT_With_CSV_DataFormat_Sets_ContentType_Header(string input)
        {
            var request = new SodaRequest(exampleUri, input, null, null, null, SodaDataFormat.CSV);

            Assert.AreEqual("text/csv", request.webRequest.ContentType);
        }

34. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[Test]
        [Category("SodaRequest")]
        public void New_Returns_Request_With_Unset_ContentLength_For_Empty_Payload()
        {
            var request = new SodaRequest(exampleUri, "POST", null, null, null);

            //The default is -1, which indicates the property has not been set and that there is no request data to send.
            //http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.contentlength(v=vs.110).aspx
            Assert.AreEqual(-1, request.webRequest.ContentLength);
        }

35. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[Test]
        [Category("SodaRequest")]
        public void New_Returns_Request_With_Specified_Uri()
        {
            var request = new SodaRequest(exampleUri, "GET", null, null, null);

            Assert.AreEqual(exampleUri, request.webRequest.RequestUri);
        }

36. Example

Project: SODA.NET
Source File: ResourceMetadataTests.cs
View license
[Test]
        [Category("ResourceMetadata")]
        public void ContactEmail_Can_Be_Read_If_Present()
        {
            string contactEmail = "[email protected]";

            var resourceMetadata = new ResourceMetadata(mockClient)
            {
                PrivateMetadata = new Dictionary<string, dynamic>()
                {
                    { "contactEmail", contactEmail }
                }
            };

            Assert.AreEqual(contactEmail, resourceMetadata.ContactEmail);
        }

37. Example

View license
[Test]
        [Category("SeparatedValuesSerializer")]
        public void DelimiterString_For_Tab_Is_Tab()
        {
            Assert.AreEqual("\t", SeparatedValuesSerializer.DelimiterString(SeparatedValuesDelimiter.Tab));
        }

38. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[TestCase("appToken1234")]
        [Category("SodaRequest")]
        public void New_Returns_Request_With_Specified_X_App_Token_Header(string input)
        {
            var request = new SodaRequest(exampleUri, "GET", input, null, null);

            Assert.AreEqual(input, request.webRequest.Headers["X-App-Token"]);
        }

39. Example

Project: SODA.NET
Source File: ResourceTests.cs
View license
[Test]
        [Category("Resource")]
        public void New_Gets_Metadata_Host()
        {
            var metadata = new ResourceMetadata(mockClient);

            var resource = new Resource<object>(metadata);

            Assert.AreEqual(metadata.Host, resource.Host);
        }

40. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[Test]
        [Category("SodaRequest")]
        public void New_GET_With_CSV_DataFormat_Sets_Accept_Header()
        {
            var request = new SodaRequest(exampleUri, "GET", null, null, null, SodaDataFormat.CSV);

            Assert.AreEqual("text/csv", request.webRequest.Accept);
        }

41. Example

Project: SODA.NET
Source File: PhoneColumnTest.cs
View license
[Test]
        [Category("PhoneColumn")]
        public void New_Deserializes_PhoneColumn_For_Invalid_Type_Json()
        {
            PhoneColumn phone = new PhoneColumn(jsonPhoneInvalidType);

            Assert.AreEqual(phoneNumber, phone.PhoneNumber);
            Assert.AreEqual(PhoneColumnType.Undefined, phone.PhoneType);
        }

42. Example

View license
[Test]
        [Category("JsonSerializationExtensions")]
        public void ToJsonString_On_Object_Serializes_To_Json_String()
        {
            object nonNullObject = new { member1 = "value1", member2 = "value2" };

            string expected = @"{""member1"":""value1"",""member2"":""value2""}";

            string nonNullObjectSerialized = nonNullObject.ToJsonString();

            Assert.AreEqual(expected, nonNullObjectSerialized);
        }

43. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[TestCase("GET")]
        [TestCase("POST")]
        [TestCase("PUT")]
        [TestCase("DELETE")]
        [Category("SodaRequest")]
        public void New_With_JSON_DataFormat_Sets_Accept_Header(string input)
        {
            var request = new SodaRequest(exampleUri, input, null, null, null, SodaDataFormat.JSON);

            Assert.AreEqual("application/json", request.webRequest.Accept);
        }

44. Example

View license
[Test]
        [Category("JsonSerializationExtensions")]
        public void ToJsonString_On_Object_Collection_Serializes_To_Json_Array()
        {
            IEnumerable<object> objectCollection = new[] { new { member = "value1" }, new { member = "value2" } };

            string expected = @"[{""member"":""value1""},{""member"":""value2""}]";

            string objectCollectionSerialized = objectCollection.ToJsonString();

            Assert.AreEqual(expected, objectCollectionSerialized);
        }

45. Example

View license
[Test]
        [Category("SeparatedValuesSerializer")]
        public void DelimiterString_For_Comma_Is_Comma()
        {
            Assert.AreEqual(",", SeparatedValuesSerializer.DelimiterString(SeparatedValuesDelimiter.Comma));
        }

46. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[Test]
        [Category("SodaRequest")]
        public void New_Sets_Timeout_To_Given_Timeout()
        {
            int timeout = 100;

            var request = new SodaRequest(exampleUri, "GET", null, null, null, SodaDataFormat.JSON, null, timeout);

            Assert.AreEqual(timeout, request.webRequest.Timeout);
        }

47. Example

Project: SODA.NET
Source File: SodaClientTests.cs
View license
[Test]
        [Category("SodaClient")]
        public void New_With_Username_Gets_Username()
        {
            string username = "userName";

            var client = new SodaClient(StringMocks.Host, StringMocks.NonEmptyInput, username, String.Empty);

            Assert.AreEqual(username, client.Username);
        }

48. Example

Project: SODA.NET
Source File: SodaRequestTests.cs
View license
[TestCase("POST")]
        [TestCase("PUT")]
        [TestCase("DELETE")]
        [Category("SodaRequest")]
        public void New_Non_GET_With_JSON_DataFormat_Sets_ContentType_Header(string input)
        {
            var request = new SodaRequest(exampleUri, input, null, null, null, SodaDataFormat.JSON);

            Assert.AreEqual("application/json", request.webRequest.ContentType);
        }

49. Example

Project: SODA.NET
Source File: ResourceMetadataTests.cs
View license
[Test]
        [Category("ResourceMetadata")]
        public void RowIdentifierField_Metadata_Can_Be_Read_If_Present()
        {
            long rowIdentifierFieldId = 12345;
            string rowIdentifierField = "rowIdentifierField";

            var resourceMetadataWithNumericRowIdentifier = new ResourceMetadata(mockClient)
            {
                Columns = new[]
                {
                    new ResourceColumn() { Id = rowIdentifierFieldId, SodaFieldName = rowIdentifierField }
                },
                Metadata = new Dictionary<string, dynamic>()
                {
                    { "rowIdentifier", rowIdentifierFieldId }
                }
            };

            Assert.AreEqual(rowIdentifierField, resourceMetadataWithNumericRowIdentifier.RowIdentifierField);

            var resourceMetadataWithTextRowIdentifier = new ResourceMetadata(mockClient)
            {
                Metadata = new Dictionary<string, dynamic>()
                {
                    { "rowIdentifier", rowIdentifierField }
                }
            };

            Assert.AreEqual(rowIdentifierField, resourceMetadataWithTextRowIdentifier.RowIdentifierField);
        }

50. Example

Project: SODA.NET
Source File: PhoneColumnTest.cs
View license
[Test]
        [Category("PhoneColumn")]
        public void New_Deserializes_PhoneColumn_For_Valid_Type_Json()
        {
            PhoneColumn phone = new PhoneColumn(jsonPhoneCellType);

            Assert.AreEqual(phoneNumber, phone.PhoneNumber);
            Assert.AreEqual(PhoneColumnType.Cell, phone.PhoneType);
        }