public void rpt_SurveyReport_ResourceName_Property_String_Type_Verify_Test() { // Arrange var rptSurveyReport = new rpt_SurveyReport(); rptSurveyReport.ResourceName = Fixture.Create <string>(); var stringType = rptSurveyReport.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_SurveyReport_Class_Invalid_Property_DetailSection3NotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test() { // Arrange const string propertyNameDetailSection3 = "DetailSection3NotPresent"; var rptSurveyReport = new rpt_SurveyReport(); // Act , Assert Should.NotThrow(action: () => rptSurveyReport.GetType().GetProperty(propertyNameDetailSection3)); }
public void rpt_SurveyReport_Class_Invalid_Property_Parameter_totalRespondentNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test() { // Arrange const string propertyNameParameterTotalRespondent = "Parameter_totalRespondentNotPresent"; var rptSurveyReport = new rpt_SurveyReport(); // Act , Assert Should.NotThrow(action: () => rptSurveyReport.GetType().GetProperty(propertyNameParameterTotalRespondent)); }
public void rpt_SurveyReport_Section2_Property_Setting_String_Throw_Argument_Exception_Test() { // Arrange const string propertyNameSection2 = "Section2"; var rptSurveyReport = new rpt_SurveyReport(); var randomString = Fixture.Create <string>(); var propertyInfo = rptSurveyReport.GetType().GetProperty(propertyNameSection2); // Act , Assert propertyInfo.ShouldNotBeNull(); Should.Throw <ArgumentException>(actual: () => propertyInfo.SetValue(rptSurveyReport, randomString, null)); }
public void rpt_SurveyReport_Section3_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNameSection3 = "Section3"; var rptSurveyReport = new rpt_SurveyReport(); var propertyInfo = rptSurveyReport.GetType().GetProperty(propertyNameSection3); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }
public void rpt_SurveyReport_Parameter_totalRespondent_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNameParameterTotalRespondent = "Parameter_totalRespondent"; var rptSurveyReport = new rpt_SurveyReport(); var propertyInfo = rptSurveyReport.GetType().GetProperty(propertyNameParameterTotalRespondent); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }
public void rpt_SurveyReport_Class_All_Properties_Getter_Settter_Test() { // Arrange var rptSurveyReport = new rpt_SurveyReport(); var resourceName = Fixture.Create <string>(); var newGenerator = true; var fullResourceName = Fixture.Create <string>(); // Act rptSurveyReport.ResourceName = resourceName; rptSurveyReport.NewGenerator = newGenerator; rptSurveyReport.FullResourceName = fullResourceName; // Assert rptSurveyReport.ResourceName.ShouldNotBeNull(); rptSurveyReport.NewGenerator.ShouldBe(newGenerator); rptSurveyReport.FullResourceName.ShouldNotBeNull(); }
public void rpt_SurveyReport_NewGenerator_Property_Bool_Type_Verify_Test() { // Arrange var rptSurveyReport = new rpt_SurveyReport(); rptSurveyReport.NewGenerator = Fixture.Create <bool>(); var boolType = rptSurveyReport.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_SurveyReport_5_Objects_Creation_No_Paramters_Test() { // Arrange var firstrptSurveyReport = new rpt_SurveyReport(); var secondrptSurveyReport = new rpt_SurveyReport(); var thirdrptSurveyReport = new rpt_SurveyReport(); var fourthrptSurveyReport = new rpt_SurveyReport(); var fifthrptSurveyReport = new rpt_SurveyReport(); var sixthrptSurveyReport = new rpt_SurveyReport(); // Act, Assert firstrptSurveyReport.ShouldNotBeNull(); secondrptSurveyReport.ShouldNotBeNull(); thirdrptSurveyReport.ShouldNotBeNull(); fourthrptSurveyReport.ShouldNotBeNull(); fifthrptSurveyReport.ShouldNotBeNull(); sixthrptSurveyReport.ShouldNotBeNull(); firstrptSurveyReport.ShouldNotBeSameAs(secondrptSurveyReport); thirdrptSurveyReport.ShouldNotBeSameAs(firstrptSurveyReport); fourthrptSurveyReport.ShouldNotBeSameAs(firstrptSurveyReport); fifthrptSurveyReport.ShouldNotBeSameAs(firstrptSurveyReport); sixthrptSurveyReport.ShouldNotBeSameAs(firstrptSurveyReport); sixthrptSurveyReport.ShouldNotBeSameAs(fourthrptSurveyReport); }