Example #1
0
        public void rpt_NoUsage_ResourceName_Property_String_Type_Verify_Test()
        {
            // Arrange
            var rptNoUsage = new rpt_NoUsage();

            rptNoUsage.ResourceName = Fixture.Create <string>();
            var stringType = rptNoUsage.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();
        }
Example #2
0
        public void rpt_NoUsage_Class_Invalid_Property_Parameter_CustomerIDNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test()
        {
            // Arrange
            const string propertyNameParameterCustomerId = "Parameter_CustomerIDNotPresent";
            var          rptNoUsage = new rpt_NoUsage();

            // Act , Assert
            Should.NotThrow(action: () => rptNoUsage.GetType().GetProperty(propertyNameParameterCustomerId));
        }
Example #3
0
        public void rpt_NoUsage_Class_Invalid_Property_NewGeneratorNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test()
        {
            // Arrange
            const string propertyNameNewGenerator = "NewGeneratorNotPresent";
            var          rptNoUsage = new rpt_NoUsage();

            // Act , Assert
            Should.NotThrow(action: () => rptNoUsage.GetType().GetProperty(propertyNameNewGenerator));
        }
Example #4
0
        public void rpt_NoUsage_Section7_Property_Setting_String_Throw_Argument_Exception_Test()
        {
            // Arrange
            const string propertyNameSection7 = "Section7";
            var          rptNoUsage           = new rpt_NoUsage();
            var          randomString         = Fixture.Create <string>();
            var          propertyInfo         = rptNoUsage.GetType().GetProperty(propertyNameSection7);

            // Act , Assert
            propertyInfo.ShouldNotBeNull();
            Should.Throw <ArgumentException>(actual: () => propertyInfo.SetValue(rptNoUsage, randomString, null));
        }
Example #5
0
        public void rpt_NoUsage_Section7_Property_Is_Present_In_Class_As_Public_Test()
        {
            // Arrange
            const string propertyNameSection7 = "Section7";
            var          rptNoUsage           = new rpt_NoUsage();
            var          propertyInfo         = rptNoUsage.GetType().GetProperty(propertyNameSection7);

            // Act
            var canRead = propertyInfo.CanRead;

            // Assert
            propertyInfo.ShouldNotBeNull();
            canRead.ShouldBeTrue();
        }
Example #6
0
        public void rpt_NoUsage_Parameter_todt_Property_Is_Present_In_Class_As_Public_Test()
        {
            // Arrange
            const string propertyNameParameterTodt = "Parameter_todt";
            var          rptNoUsage   = new rpt_NoUsage();
            var          propertyInfo = rptNoUsage.GetType().GetProperty(propertyNameParameterTodt);

            // Act
            var canRead = propertyInfo.CanRead;

            // Assert
            propertyInfo.ShouldNotBeNull();
            canRead.ShouldBeTrue();
        }
Example #7
0
        public void rpt_NoUsage_NewGenerator_Property_Bool_Type_Verify_Test()
        {
            // Arrange
            var rptNoUsage = new rpt_NoUsage();

            rptNoUsage.NewGenerator = Fixture.Create <bool>();
            var boolType = rptNoUsage.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();
        }
Example #8
0
        public void Constructor_rpt_NoUsage_5_Objects_Creation_No_Paramters_Test()
        {
            // Arrange
            var firstrptNoUsage  = new rpt_NoUsage();
            var secondrptNoUsage = new rpt_NoUsage();
            var thirdrptNoUsage  = new rpt_NoUsage();
            var fourthrptNoUsage = new rpt_NoUsage();
            var fifthrptNoUsage  = new rpt_NoUsage();
            var sixthrptNoUsage  = new rpt_NoUsage();

            // Act, Assert
            firstrptNoUsage.ShouldNotBeNull();
            secondrptNoUsage.ShouldNotBeNull();
            thirdrptNoUsage.ShouldNotBeNull();
            fourthrptNoUsage.ShouldNotBeNull();
            fifthrptNoUsage.ShouldNotBeNull();
            sixthrptNoUsage.ShouldNotBeNull();
            firstrptNoUsage.ShouldNotBeSameAs(secondrptNoUsage);
            thirdrptNoUsage.ShouldNotBeSameAs(firstrptNoUsage);
            fourthrptNoUsage.ShouldNotBeSameAs(firstrptNoUsage);
            fifthrptNoUsage.ShouldNotBeSameAs(firstrptNoUsage);
            sixthrptNoUsage.ShouldNotBeSameAs(firstrptNoUsage);
            sixthrptNoUsage.ShouldNotBeSameAs(fourthrptNoUsage);
        }