예제 #1
0
        public void ShouldNotThrowGivenMatchingPrimitive()
        {
            //Arrange
            ClassVariableTypeValidation subject = new ClassVariableTypeValidation()
                                                  .FieldShouldBeType <string>("_value", "stringValue");
            VariabledClass target = new VariabledClass();

            //Act
            subject.AssertFieldsAreExpectedType(target);

            //Assert
        }
예제 #2
0
        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();
        }
예제 #3
0
 public ExampleObject(VariabledClass variable) => _variable = variable;