Пример #1
0
        public void rpt_ChannelLook_ResourceName_Property_String_Type_Verify_Test()
        {
            // Arrange
            var rptChannelLook = new rpt_ChannelLook();

            rptChannelLook.ResourceName = Fixture.Create <string>();
            var stringType = rptChannelLook.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_ChannelLook_Class_Invalid_Property_Parameter_CustomerIDNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test()
        {
            // Arrange
            const string propertyNameParameterCustomerId = "Parameter_CustomerIDNotPresent";
            var          rptChannelLook = new rpt_ChannelLook();

            // Act , Assert
            Should.NotThrow(action: () => rptChannelLook.GetType().GetProperty(propertyNameParameterCustomerId));
        }
Пример #3
0
        public void rpt_ChannelLook_Class_Invalid_Property_NewGeneratorNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test()
        {
            // Arrange
            const string propertyNameNewGenerator = "NewGeneratorNotPresent";
            var          rptChannelLook           = new rpt_ChannelLook();

            // Act , Assert
            Should.NotThrow(action: () => rptChannelLook.GetType().GetProperty(propertyNameNewGenerator));
        }
Пример #4
0
        public void rpt_ChannelLook_Section8_Property_Setting_String_Throw_Argument_Exception_Test()
        {
            // Arrange
            const string propertyNameSection8 = "Section8";
            var          rptChannelLook       = new rpt_ChannelLook();
            var          randomString         = Fixture.Create <string>();
            var          propertyInfo         = rptChannelLook.GetType().GetProperty(propertyNameSection8);

            // Act , Assert
            propertyInfo.ShouldNotBeNull();
            Should.Throw <ArgumentException>(actual: () => propertyInfo.SetValue(rptChannelLook, randomString, null));
        }
Пример #5
0
        public void rpt_ChannelLook_Section8_Property_Is_Present_In_Class_As_Public_Test()
        {
            // Arrange
            const string propertyNameSection8 = "Section8";
            var          rptChannelLook       = new rpt_ChannelLook();
            var          propertyInfo         = rptChannelLook.GetType().GetProperty(propertyNameSection8);

            // Act
            var canRead = propertyInfo.CanRead;

            // Assert
            propertyInfo.ShouldNotBeNull();
            canRead.ShouldBeTrue();
        }
Пример #6
0
        public void rpt_ChannelLook_Parameter_todt_Property_Is_Present_In_Class_As_Public_Test()
        {
            // Arrange
            const string propertyNameParameterTodt = "Parameter_todt";
            var          rptChannelLook            = new rpt_ChannelLook();
            var          propertyInfo = rptChannelLook.GetType().GetProperty(propertyNameParameterTodt);

            // Act
            var canRead = propertyInfo.CanRead;

            // Assert
            propertyInfo.ShouldNotBeNull();
            canRead.ShouldBeTrue();
        }
Пример #7
0
        public void rpt_ChannelLook_NewGenerator_Property_Bool_Type_Verify_Test()
        {
            // Arrange
            var rptChannelLook = new rpt_ChannelLook();

            rptChannelLook.NewGenerator = Fixture.Create <bool>();
            var boolType = rptChannelLook.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_ChannelLook_5_Objects_Creation_No_Paramters_Test()
        {
            // Arrange
            var firstrptChannelLook  = new rpt_ChannelLook();
            var secondrptChannelLook = new rpt_ChannelLook();
            var thirdrptChannelLook  = new rpt_ChannelLook();
            var fourthrptChannelLook = new rpt_ChannelLook();
            var fifthrptChannelLook  = new rpt_ChannelLook();
            var sixthrptChannelLook  = new rpt_ChannelLook();

            // Act, Assert
            firstrptChannelLook.ShouldNotBeNull();
            secondrptChannelLook.ShouldNotBeNull();
            thirdrptChannelLook.ShouldNotBeNull();
            fourthrptChannelLook.ShouldNotBeNull();
            fifthrptChannelLook.ShouldNotBeNull();
            sixthrptChannelLook.ShouldNotBeNull();
            firstrptChannelLook.ShouldNotBeSameAs(secondrptChannelLook);
            thirdrptChannelLook.ShouldNotBeSameAs(firstrptChannelLook);
            fourthrptChannelLook.ShouldNotBeSameAs(firstrptChannelLook);
            fifthrptChannelLook.ShouldNotBeSameAs(firstrptChannelLook);
            sixthrptChannelLook.ShouldNotBeSameAs(firstrptChannelLook);
            sixthrptChannelLook.ShouldNotBeSameAs(fourthrptChannelLook);
        }