public void ShouldNotThrowGivenMatchingPrimitive() { //Arrange ClassVariableTypeValidation subject = new ClassVariableTypeValidation() .FieldShouldBeType <string>("_value", "stringValue"); VariabledClass target = new VariabledClass(); //Act subject.AssertFieldsAreExpectedType(target); //Assert }
public void ShouldNotThrowGivenSameObject() { //Arrange VariabledClass expectedValue = new VariabledClass(); ExampleObject exampleObject = new ExampleObject(expectedValue); ClassVariableTypeValidation subject = new ClassVariableTypeValidation() .FieldShouldBeType <VariabledClass>("_variable", expectedValue); //Act Action action = () => subject.AssertFieldsAreExpectedType(exampleObject); //Assert action.Should().NotThrow(); }
public ExampleObject(VariabledClass variable) => _variable = variable;