Example #1
0
        public void TestPropertyTypeSetNull_WithSystemType_FluentAPI_ThrowsArgumentNullException()
        {
            // Arrange
            string          propertyName    = "property";
            string          propertyType    = "int";
            Type            newPropertyType = null;
            SGClassProperty property        = new SGClassProperty(propertyName, propertyType);

            // Act
            property = property.WithPropertyType(newPropertyType);
        }
Example #2
0
        public void TestPropertyTypeSetEmpty_FluentAPI_ThrowsArgumentException()
        {
            // Arrange
            string          propertyName    = "property";
            string          propertyType    = "int";
            string          newPropertyType = String.Empty;
            SGClassProperty property        = new SGClassProperty(propertyName, propertyType);

            // Act
            property = property.WithPropertyType(newPropertyType);
        }
Example #3
0
        public void TestPropertyTypeSet_WithSystemType_FluentAPI()
        {
            // Arrange
            string          propertyName    = "property";
            string          propertyType    = "int";
            Type            newPropertyType = typeof(bool);
            SGClassProperty property        = new SGClassProperty(propertyName, propertyType);

            // Act
            property = property.WithPropertyType(newPropertyType);

            // Assert
            Assert.AreEqual(newPropertyType.Name, property.PropertyType);
        }
Example #4
0
        public void TestPropertyTypeSet_FluentAPI()
        {
            // Arrange
            string          propertyName    = "property";
            string          propertyType    = "int";
            string          newPropertyType = "bool";
            SGClassProperty property        = new SGClassProperty(propertyName, propertyType);

            // Act
            property = property.WithPropertyType(newPropertyType);

            // Assert
            Assert.AreEqual(newPropertyType, property.PropertyType);
        }