示例#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;