public void ThrowsInvalidOperationException_ForWhiteSpaceString() { const string friendlyNameString = " \t\r\n "; InvalidOperationException exception = null; try { var friendlyNameEnum = friendlyNameString.AsSamlAttributeFriendlyName(); friendlyNameEnum.ShouldBeNull(); } catch (InvalidOperationException ex) { exception = ex; } exception.ShouldNotBeNull(); }
public void ThrowsInvalidOperationException_ForEmptyString() { var friendlyNameString = string.Empty; InvalidOperationException exception = null; try { var friendlyNameEnum = friendlyNameString.AsSamlAttributeFriendlyName(); friendlyNameEnum.ShouldBeNull(); } catch (InvalidOperationException ex) { exception = ex; } exception.ShouldNotBeNull(); }
public void ThrowsInvalidOperationException_ForMisspelledEduPersonPrincipalNameString() { const string friendlyNameString = "EduPersonPrincipalName"; InvalidOperationException exception = null; try { var friendlyNameEnum = friendlyNameString.AsSamlAttributeFriendlyName(); friendlyNameEnum.ShouldBeNull(); } catch (InvalidOperationException ex) { exception = ex; } exception.ShouldNotBeNull(); }
public void Process_should_throw_invalid_operation_exception_if_package_not_found() { const string filename = @"..\..\..\acceptance-test\package.update"; InvalidOperationException exceptionThrown = null; try { _reader.GetManifest(filename); } catch (InvalidOperationException ex) { exceptionThrown = ex; } exceptionThrown.ShouldNotBeNull(); }
public void ThrowsInvalidOperationException_ForNullString() { const string friendlyNameString = null; InvalidOperationException exception = null; try { // ReSharper disable ExpressionIsAlwaysNull var friendlyNameEnum = friendlyNameString.AsSamlAttributeFriendlyName(); // ReSharper restore ExpressionIsAlwaysNull friendlyNameEnum.ShouldBeNull(); } catch (InvalidOperationException ex) { exception = ex; } exception.ShouldNotBeNull(); }
public void ThrowsInvalidOperationException_WhenTokenParamValue_IsNotFound() { const string paramName = "some value"; var attribute = new ValidateConfirmEmailAttribute(paramName); var filterContext = CreateFilterContext(paramName, "not a guid or interface"); InvalidOperationException exception = null; try { attribute.GetToken(filterContext); } catch (InvalidOperationException ex) { exception = ex; } exception.ShouldNotBeNull(); // ReSharper disable PossibleNullReferenceException exception.Message.ShouldContain(paramName); // ReSharper restore PossibleNullReferenceException }
public void then_it_throws_an_exception() { _exception.ShouldNotBeNull(); }