public void rpt_SurveyRespondents_ResourceName_Property_String_Type_Verify_Test() { // Arrange var rptSurveyRespondents = new rpt_SurveyRespondents(); rptSurveyRespondents.ResourceName = Fixture.Create <string>(); var stringType = rptSurveyRespondents.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_SurveyRespondents_Class_Invalid_Property_Parameter_ExportFormatNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test() { // Arrange const string propertyNameParameterExportFormat = "Parameter_ExportFormatNotPresent"; var rptSurveyRespondents = new rpt_SurveyRespondents(); // Act , Assert Should.NotThrow(action: () => rptSurveyRespondents.GetType().GetProperty(propertyNameParameterExportFormat)); }
public void rpt_SurveyRespondents_Class_Invalid_Property_NewGeneratorNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test() { // Arrange const string propertyNameNewGenerator = "NewGeneratorNotPresent"; var rptSurveyRespondents = new rpt_SurveyRespondents(); // Act , Assert Should.NotThrow(action: () => rptSurveyRespondents.GetType().GetProperty(propertyNameNewGenerator)); }
public void rpt_SurveyRespondents_Section6_Property_Setting_String_Throw_Argument_Exception_Test() { // Arrange const string propertyNameSection6 = "Section6"; var rptSurveyRespondents = new rpt_SurveyRespondents(); var randomString = Fixture.Create <string>(); var propertyInfo = rptSurveyRespondents.GetType().GetProperty(propertyNameSection6); // Act , Assert propertyInfo.ShouldNotBeNull(); Should.Throw <ArgumentException>(actual: () => propertyInfo.SetValue(rptSurveyRespondents, randomString, null)); }
public void rpt_SurveyRespondents_Section6_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNameSection6 = "Section6"; var rptSurveyRespondents = new rpt_SurveyRespondents(); var propertyInfo = rptSurveyRespondents.GetType().GetProperty(propertyNameSection6); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }
public void rpt_SurveyRespondents_Parameter_filterstr_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNameParameterFilterstr = "Parameter_filterstr"; var rptSurveyRespondents = new rpt_SurveyRespondents(); var propertyInfo = rptSurveyRespondents.GetType().GetProperty(propertyNameParameterFilterstr); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }
public void rpt_SurveyRespondents_NewGenerator_Property_Bool_Type_Verify_Test() { // Arrange var rptSurveyRespondents = new rpt_SurveyRespondents(); rptSurveyRespondents.NewGenerator = Fixture.Create <bool>(); var boolType = rptSurveyRespondents.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_SurveyRespondents_5_Objects_Creation_No_Paramters_Test() { // Arrange var firstrptSurveyRespondents = new rpt_SurveyRespondents(); var secondrptSurveyRespondents = new rpt_SurveyRespondents(); var thirdrptSurveyRespondents = new rpt_SurveyRespondents(); var fourthrptSurveyRespondents = new rpt_SurveyRespondents(); var fifthrptSurveyRespondents = new rpt_SurveyRespondents(); var sixthrptSurveyRespondents = new rpt_SurveyRespondents(); // Act, Assert firstrptSurveyRespondents.ShouldNotBeNull(); secondrptSurveyRespondents.ShouldNotBeNull(); thirdrptSurveyRespondents.ShouldNotBeNull(); fourthrptSurveyRespondents.ShouldNotBeNull(); fifthrptSurveyRespondents.ShouldNotBeNull(); sixthrptSurveyRespondents.ShouldNotBeNull(); firstrptSurveyRespondents.ShouldNotBeSameAs(secondrptSurveyRespondents); thirdrptSurveyRespondents.ShouldNotBeSameAs(firstrptSurveyRespondents); fourthrptSurveyRespondents.ShouldNotBeSameAs(firstrptSurveyRespondents); fifthrptSurveyRespondents.ShouldNotBeSameAs(firstrptSurveyRespondents); sixthrptSurveyRespondents.ShouldNotBeSameAs(firstrptSurveyRespondents); sixthrptSurveyRespondents.ShouldNotBeSameAs(fourthrptSurveyRespondents); }