public void AccountsHomePage_SubMenu_Property_String_Type_Verify_Test() { // Arrange var accountsHomePage = new AccountsHomePage(); accountsHomePage.SubMenu = Fixture.Create <string>(); var stringType = accountsHomePage.SubMenu.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 Setup() { _accountsHomePage = new AccountsHomePage(); _accountsHomePagePrivate = new PrivateObject(_accountsHomePage); _siteMapSecondLevelField = new SiteMapDataSource(); _menuField = new Menu(); _shimsContext = ShimsContext.Create(); InitializeFields(); }
public void AccountsHomePage_Class_Invalid_Property_virtualPathNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test() { // Arrange const string propertyNamevirtualPath = "virtualPathNotPresent"; var accountsHomePage = new AccountsHomePage(); // Act , Assert Should.NotThrow(() => accountsHomePage.GetType().GetProperty(propertyNamevirtualPath)); }
public void AccountsHomePage_UserSession_Property_Setting_String_Throw_Argument_Exception_Test() { // Arrange const string propertyNameUserSession = "UserSession"; var accountsHomePage = new AccountsHomePage(); var randomString = Fixture.Create <string>(); var propertyInfo = accountsHomePage.GetType().GetProperty(propertyNameUserSession); // Act , Assert propertyInfo.ShouldNotBeNull(); Should.Throw <ArgumentException>(() => propertyInfo.SetValue(accountsHomePage, randomString, null)); }
public void AccountsHomePage_virtualPath_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNamevirtualPath = "virtualPath"; var accountsHomePage = new AccountsHomePage(); var propertyInfo = accountsHomePage.GetType().GetProperty(propertyNamevirtualPath); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }
public void AccountsHomePage_CurrentMenuCode_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNameCurrentMenuCode = "CurrentMenuCode"; var accountsHomePage = new AccountsHomePage(); var propertyInfo = accountsHomePage.GetType().GetProperty(propertyNameCurrentMenuCode); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }