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
0
1. Example
View license[Test] public void CommitChangesPropagation() { // Create a linear transform hierarchy from roo/n ..... /n //View Source file for more details /n }
0
2. Example
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))); }
0
3. Example
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)); }
0
4. Example
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)); }
0
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))); }
0
6. Example
View license[Test] public void ShouldHaveEDBFileWatchWithNetworkAreasAttribute() { Assert.AreEqual("DMZ|APP", _LogSearchShipper.EDBFileWatchers[1].NetworkAreas); }
0
7. Example
View license[Test] public void ShouldHaveEDBFileWatchWithServiceNamesAttribute() { Assert.AreEqual("nolio.*", _LogSearchShipper.EDBFileWatchers[1].ServiceNames); }
0
8. Example
View license[Test] public void ShouldHaveIngestorHostAttribute() { Assert.AreEqual("ingestor.example.com", _LogSearchShipper.IngestorHost); }
0
9. Example
View license[Test] public void ShouldHaveIngestorPortAttribute() { Assert.AreEqual(443, _LogSearchShipper.IngestorPort); }
0
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); }
0
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); }
0
12. Example
View license[Test] public void ShouldHaveFileWatchWithTypeAttribute() { Assert.AreEqual("myfile_type", _LogSearchShipper.FileWatchers[0].Type); }
0
13. Example
View license[Test] public void ShouldHaveEDBFileWatchWithDataFileAttribute() { Assert.AreEqual(@"SampleData\EDB\ENV1\Latest.xml", _LogSearchShipper.EDBFileWatchers[0].DataFile); }
0
14. Example
View license[Test] public void ShouldHaveEDBFileWatchWithServerNamesAttribute() { Assert.AreEqual("(.*01|.*02)", _LogSearchShipper.EDBFileWatchers[1].ServerNames); }
0
15. Example
View license[Test] public void ShouldHaveEDBFileWatchWithLogEnvironmentDiagramDataEveryMinutes() { Assert.AreEqual(42, _LogSearchShipper.EDBFileWatchers[0].LogEnvironmentDiagramDataEveryMinutes); }
0
16. Example
View license[Test] public void ShouldHaveFileWatchWithFilesAttribute() { Assert.AreEqual("myfile.log", _LogSearchShipper.FileWatchers[0].Files); }
0
17. Example
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); }
0
18. Example
View license[Test] public void HowToUseWatchLists() { var rpcClient = BuildRpcClien/n ..... /n //View Source file for more details /n }
0
19. Example
View license[Test] public void CanGetPriceTicks() { var rpcClient = BuildRpcClient(); var response = rpcClient.PriceHistory.GetPriceTicks("71442","10"); Assert.AreEqual(10, response.PriceTicks.Length); }
0
20. Example
View license[Test] public void HowToUseWatchLists() { var rpcClient = BuildRpcClient(); /n ..... /n //View Source file for more details /n }
0
21. Example
View license[Test] public void CanGetPriceTicks() { var rpcClient = BuildRpcClient("CanGetPriceTicks"); var response = rpcClient.PriceHistory.GetPriceTicks("400158776", "10"); Assert.AreEqual(10, response.PriceTicks.Length); }
0
22. Example
View license[Test] public void CanGetPriceTicks() { var rpcClient = BuildRpcClient(); var response = rpcClient.PriceHistory.GetPriceTicks("400158776", "10"); Assert.AreEqual(10, response.PriceTicks.Length); }
0
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()); }
0
24. Example
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); }
0
25. Example
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); }
0
26. Example
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(); }
0
27. Example
View license[Test] public void CanGetPriceBars() { var rpcClient = BuildRpcClient(); var response = rpcClient.PriceHistory.GetPriceBars("400158776", "MINUTE", 10, "10"); Assert.AreEqual(10, response.PriceBars.Length); }
0
28. Example
View license[Test] public void HowToUseWatchLists() { var rpcClient = BuildRpcClien/n ..... /n //View Source file for more details /n }
0
29. Example
View license[Test] public void CanGetPriceBars() { var rpcClient = BuildRpcClient(); var response = rpcClient.PriceHistory.GetPriceBars("71442", "MINUTE", 10, "10"); Assert.AreEqual(10, response.PriceBars.Length); }
0
30. Example
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); }
0
31. Example
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); }
0
32. Example
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); }
0
33. Example
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); }
0
34. Example
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); }
0
35. Example
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); }
0
36. Example
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); }
0
37. Example
View license[Test] [Category("SeparatedValuesSerializer")] public void DelimiterString_For_Tab_Is_Tab() { Assert.AreEqual("\t", SeparatedValuesSerializer.DelimiterString(SeparatedValuesDelimiter.Tab)); }
0
38. Example
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"]); }
0
39. Example
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); }
0
40. Example
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); }
0
41. Example
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); }
0
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); }
0
43. Example
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); }
0
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); }
0
45. Example
View license[Test] [Category("SeparatedValuesSerializer")] public void DelimiterString_For_Comma_Is_Comma() { Assert.AreEqual(",", SeparatedValuesSerializer.DelimiterString(SeparatedValuesDelimiter.Comma)); }
0
46. Example
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); }
0
47. Example
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); }
0
48. Example
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); }
0
49. Example
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); }
0
50. Example
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); }