public static void Equal(ApiProperty expected, ApiProperty actual) { if (expected == null) { Assert.Null(actual); return; } Assert.NotNull(actual); Assert.Equal(expected.Name, actual.Name); ClrObjectAssert.Equal(expected.ValueAsObject(), actual.ValueAsObject()); }
// PUBLIC METHODS /////////////////////////////////////////////////// #region Assert Methods public static void Equal(ApiProperty expected, JToken actualJToken) { // Handle when 'expected' is null. if (expected == null) { ClrObjectAssert.IsNull(actualJToken); return; } // Handle when 'expected' is not null. Assert.NotNull(actualJToken); var actualJTokenType = actualJToken.Type; Assert.Equal(JTokenType.Property, actualJTokenType); var actualJProperty = (JProperty)actualJToken; Assert.Equal(expected.Name, actualJProperty.Name); ClrObjectAssert.Equal(expected.ValueAsObject(), actualJProperty.Value); }