public void ValidateReferenceTypeToBeOfType() { // Given var validator = new ReferenceTypeValidator <object>(42); // When validator.BeOfType <Int32>(); // Then Assert.True(true); }
public void ValidateReferenceTypeToBeOfTypeViolated() { // Given var validator = new ReferenceTypeValidator <object>(42); // When var exception = Assert.Throws <XunitException>(() => validator.BeOfType <String>()); // Then Assert.NotNull(exception); var rn = Environment.NewLine; Assert.Equal( $"{rn}validator{rn}is \"Int32\"{rn}but was expected to be of type \"String\"", exception.UserMessage); }