コード例 #1
0
        public void rpt_newUser_ResourceName_Property_String_Type_Verify_Test()
        {
            // Arrange
            var rptNewUser = new rpt_newUser();

            rptNewUser.ResourceName = Fixture.Create <string>();
            var stringType = rptNewUser.ResourceName.GetType();

            // Act
            var isTypeString  = typeof(string) == stringType;
            var isTypeInt     = typeof(int) == stringType;
            var isTypeDecimal = typeof(decimal) == stringType;
            var isTypeLong    = typeof(long) == stringType;
            var isTypeBool    = typeof(bool) == stringType;
            var isTypeDouble  = typeof(double) == stringType;
            var isTypeFloat   = typeof(float) == stringType;

            // Assert
            isTypeString.ShouldBeTrue();
            isTypeInt.ShouldBeFalse();
            isTypeDecimal.ShouldBeFalse();
            isTypeLong.ShouldBeFalse();
            isTypeBool.ShouldBeFalse();
            isTypeDouble.ShouldBeFalse();
            isTypeFloat.ShouldBeFalse();
        }
コード例 #2
0
        public void rpt_newUser_Class_Invalid_Property_Parameter_testblastNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test()
        {
            // Arrange
            const string propertyNameParameterTestblast = "Parameter_testblastNotPresent";
            var          rptNewUser = new rpt_newUser();

            // Act , Assert
            Should.NotThrow(action: () => rptNewUser.GetType().GetProperty(propertyNameParameterTestblast));
        }
コード例 #3
0
        public void rpt_newUser_Class_Invalid_Property_FullResourceNameNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test()
        {
            // Arrange
            const string propertyNameFullResourceName = "FullResourceNameNotPresent";
            var          rptNewUser = new rpt_newUser();

            // Act , Assert
            Should.NotThrow(action: () => rptNewUser.GetType().GetProperty(propertyNameFullResourceName));
        }
コード例 #4
0
        public void rpt_newUser_Section9_Property_Setting_String_Throw_Argument_Exception_Test()
        {
            // Arrange
            const string propertyNameSection9 = "Section9";
            var          rptNewUser           = new rpt_newUser();
            var          randomString         = Fixture.Create <string>();
            var          propertyInfo         = rptNewUser.GetType().GetProperty(propertyNameSection9);

            // Act , Assert
            propertyInfo.ShouldNotBeNull();
            Should.Throw <ArgumentException>(actual: () => propertyInfo.SetValue(rptNewUser, randomString, null));
        }
コード例 #5
0
        public void rpt_newUser_Section9_Property_Is_Present_In_Class_As_Public_Test()
        {
            // Arrange
            const string propertyNameSection9 = "Section9";
            var          rptNewUser           = new rpt_newUser();
            var          propertyInfo         = rptNewUser.GetType().GetProperty(propertyNameSection9);

            // Act
            var canRead = propertyInfo.CanRead;

            // Assert
            propertyInfo.ShouldNotBeNull();
            canRead.ShouldBeTrue();
        }
コード例 #6
0
        public void rpt_newUser_Parameter_testblast_Property_Is_Present_In_Class_As_Public_Test()
        {
            // Arrange
            const string propertyNameParameterTestblast = "Parameter_testblast";
            var          rptNewUser   = new rpt_newUser();
            var          propertyInfo = rptNewUser.GetType().GetProperty(propertyNameParameterTestblast);

            // Act
            var canRead = propertyInfo.CanRead;

            // Assert
            propertyInfo.ShouldNotBeNull();
            canRead.ShouldBeTrue();
        }
コード例 #7
0
        public void rpt_newUser_NewGenerator_Property_Bool_Type_Verify_Test()
        {
            // Arrange
            var rptNewUser = new rpt_newUser();

            rptNewUser.NewGenerator = Fixture.Create <bool>();
            var boolType = rptNewUser.NewGenerator.GetType();

            // Act
            var isTypeBool            = typeof(bool) == boolType;
            var isTypeNullableBool    = typeof(bool?) == boolType;
            var isTypeString          = typeof(string) == boolType;
            var isTypeInt             = typeof(int) == boolType;
            var isTypeDecimal         = typeof(decimal) == boolType;
            var isTypeLong            = typeof(long) == boolType;
            var isTypeDouble          = typeof(double) == boolType;
            var isTypeFloat           = typeof(float) == boolType;
            var isTypeIntNullable     = typeof(int?) == boolType;
            var isTypeDecimalNullable = typeof(decimal?) == boolType;
            var isTypeLongNullable    = typeof(long?) == boolType;
            var isTypeDoubleNullable  = typeof(double?) == boolType;
            var isTypeFloatNullable   = typeof(float?) == boolType;

            // Assert
            isTypeBool.ShouldBeTrue();
            isTypeString.ShouldBeFalse();
            isTypeNullableBool.ShouldBeFalse();
            isTypeInt.ShouldBeFalse();
            isTypeDecimal.ShouldBeFalse();
            isTypeLong.ShouldBeFalse();
            isTypeDouble.ShouldBeFalse();
            isTypeFloat.ShouldBeFalse();
            isTypeIntNullable.ShouldBeFalse();
            isTypeDecimalNullable.ShouldBeFalse();
            isTypeLongNullable.ShouldBeFalse();
            isTypeDoubleNullable.ShouldBeFalse();
            isTypeFloatNullable.ShouldBeFalse();
        }
コード例 #8
0
        public void Constructor_rpt_newUser_5_Objects_Creation_No_Paramters_Test()
        {
            // Arrange
            var firstrptNewUser  = new rpt_newUser();
            var secondrptNewUser = new rpt_newUser();
            var thirdrptNewUser  = new rpt_newUser();
            var fourthrptNewUser = new rpt_newUser();
            var fifthrptNewUser  = new rpt_newUser();
            var sixthrptNewUser  = new rpt_newUser();

            // Act, Assert
            firstrptNewUser.ShouldNotBeNull();
            secondrptNewUser.ShouldNotBeNull();
            thirdrptNewUser.ShouldNotBeNull();
            fourthrptNewUser.ShouldNotBeNull();
            fifthrptNewUser.ShouldNotBeNull();
            sixthrptNewUser.ShouldNotBeNull();
            firstrptNewUser.ShouldNotBeSameAs(secondrptNewUser);
            thirdrptNewUser.ShouldNotBeSameAs(firstrptNewUser);
            fourthrptNewUser.ShouldNotBeSameAs(firstrptNewUser);
            fifthrptNewUser.ShouldNotBeSameAs(firstrptNewUser);
            sixthrptNewUser.ShouldNotBeSameAs(firstrptNewUser);
            sixthrptNewUser.ShouldNotBeSameAs(fourthrptNewUser);
        }