public void rpt_SurveyTextResponse_ResourceName_Property_String_Type_Verify_Test() { // Arrange var rptSurveyTextResponse = new rpt_SurveyTextResponse(); rptSurveyTextResponse.ResourceName = Fixture.Create <string>(); var stringType = rptSurveyTextResponse.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(); }
public void rpt_SurveyTextResponse_Class_Invalid_Property_Parameter_OtherTextNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test() { // Arrange const string propertyNameParameterOtherText = "Parameter_OtherTextNotPresent"; var rptSurveyTextResponse = new rpt_SurveyTextResponse(); // Act , Assert Should.NotThrow(action: () => rptSurveyTextResponse.GetType().GetProperty(propertyNameParameterOtherText)); }
public void rpt_SurveyTextResponse_Section6_Property_Setting_String_Throw_Argument_Exception_Test() { // Arrange const string propertyNameSection6 = "Section6"; var rptSurveyTextResponse = new rpt_SurveyTextResponse(); var randomString = Fixture.Create <string>(); var propertyInfo = rptSurveyTextResponse.GetType().GetProperty(propertyNameSection6); // Act , Assert propertyInfo.ShouldNotBeNull(); Should.Throw <ArgumentException>(actual: () => propertyInfo.SetValue(rptSurveyTextResponse, randomString, null)); }
public void rpt_SurveyTextResponse_Section6_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNameSection6 = "Section6"; var rptSurveyTextResponse = new rpt_SurveyTextResponse(); var propertyInfo = rptSurveyTextResponse.GetType().GetProperty(propertyNameSection6); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }
public void rpt_SurveyTextResponse_Parameter_OtherText_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNameParameterOtherText = "Parameter_OtherText"; var rptSurveyTextResponse = new rpt_SurveyTextResponse(); var propertyInfo = rptSurveyTextResponse.GetType().GetProperty(propertyNameParameterOtherText); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }
public void rpt_SurveyTextResponse_NewGenerator_Property_Bool_Type_Verify_Test() { // Arrange var rptSurveyTextResponse = new rpt_SurveyTextResponse(); rptSurveyTextResponse.NewGenerator = Fixture.Create <bool>(); var boolType = rptSurveyTextResponse.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(); }
public void Constructor_rpt_SurveyTextResponse_5_Objects_Creation_No_Paramters_Test() { // Arrange var firstrptSurveyTextResponse = new rpt_SurveyTextResponse(); var secondrptSurveyTextResponse = new rpt_SurveyTextResponse(); var thirdrptSurveyTextResponse = new rpt_SurveyTextResponse(); var fourthrptSurveyTextResponse = new rpt_SurveyTextResponse(); var fifthrptSurveyTextResponse = new rpt_SurveyTextResponse(); var sixthrptSurveyTextResponse = new rpt_SurveyTextResponse(); // Act, Assert firstrptSurveyTextResponse.ShouldNotBeNull(); secondrptSurveyTextResponse.ShouldNotBeNull(); thirdrptSurveyTextResponse.ShouldNotBeNull(); fourthrptSurveyTextResponse.ShouldNotBeNull(); fifthrptSurveyTextResponse.ShouldNotBeNull(); sixthrptSurveyTextResponse.ShouldNotBeNull(); firstrptSurveyTextResponse.ShouldNotBeSameAs(secondrptSurveyTextResponse); thirdrptSurveyTextResponse.ShouldNotBeSameAs(firstrptSurveyTextResponse); fourthrptSurveyTextResponse.ShouldNotBeSameAs(firstrptSurveyTextResponse); fifthrptSurveyTextResponse.ShouldNotBeSameAs(firstrptSurveyTextResponse); sixthrptSurveyTextResponse.ShouldNotBeSameAs(firstrptSurveyTextResponse); sixthrptSurveyTextResponse.ShouldNotBeSameAs(fourthrptSurveyTextResponse); }