public void Accounts_Class_Invalid_Property_virtualPathNotPresent_Access_Using_Reflexion_Doesnt_Throw_Exception_Test() { // Arrange const string propertyNamevirtualPath = "virtualPathNotPresent"; var accounts = new ecn.accounts.MasterPages.Accounts(); // Act , Assert Should.NotThrow(() => accounts.GetType().GetProperty(propertyNamevirtualPath)); }
public void Accounts_UserSession_Property_Setting_String_Throw_Argument_Exception_Test() { // Arrange const string propertyNameUserSession = "UserSession"; var accounts = new ecn.accounts.MasterPages.Accounts(); var randomString = Fixture.Create <string>(); var propertyInfo = accounts.GetType().GetProperty(propertyNameUserSession); // Act , Assert propertyInfo.ShouldNotBeNull(); Should.Throw <ArgumentException>(() => propertyInfo.SetValue(accounts, randomString, null)); }
public void Accounts_virtualPath_Property_Is_Present_In_Class_As_Public_Test() { // Arrange const string propertyNamevirtualPath = "virtualPath"; var accounts = new ecn.accounts.MasterPages.Accounts(); var propertyInfo = accounts.GetType().GetProperty(propertyNamevirtualPath); // Act var canRead = propertyInfo.CanRead; // Assert propertyInfo.ShouldNotBeNull(); canRead.ShouldBeTrue(); }