public void NothingElseCalled_ModalsReturned() { //Arrange SandboxDirectiveBuilder builder = new SandboxDirectiveBuilder(); //Act builder.AllowModals(); //Assert string result = builder.Build(); Assert.Equal("allow-modals", result); }
public void DuplicateModalsAllowed_DuplicatesRemoved() { //Arrange SandboxDirectiveBuilder builder = new SandboxDirectiveBuilder(); //Act builder.AllowModals().AllowModals(); //Assert string result = builder.Build(); Assert.Equal("allow-modals", result); }
public void SomethingElseCalled_PopupsIncluded() { //Arrange SandboxDirectiveBuilder builder = new SandboxDirectiveBuilder(); //Act builder.AllowModals(); builder.AllowPopups(); builder.AllowForms(); //Assert string result = builder.Build(); Assert.Equal("allow-forms allow-modals allow-popups", result); }
public void SomethingElseCalled_OrientationLockIncluded() { //Arrange SandboxDirectiveBuilder builder = new SandboxDirectiveBuilder(); //Act builder.AllowModals(); builder.AllowOrientationLock(); builder.AllowForms(); //Assert string result = builder.Build(); Assert.Equal("allow-forms allow-modals allow-orientation-lock", result); }
public void SomethingElseAllowed_OtherssIgnored() { //Arrange SandboxDirectiveBuilder builder = new SandboxDirectiveBuilder(); //Act builder.AllowForms(); builder.AllowModals(); builder.AllowAny(); //Assert string result = builder.Build(); Assert.Equal("'*'", result); }
public void SomethingElseCalled_SameOriginIncluded() { //Arrange SandboxDirectiveBuilder builder = new SandboxDirectiveBuilder(); //Act builder.AllowModals(); builder.AllowSameOrigin(); builder.AllowPopups(); //Assert string result = builder.Build(); Assert.Equal("allow-modals allow-popups allow-same-origin", result); }
public void SomethingElseCalled_TopNavigationIncluded() { //Arrange SandboxDirectiveBuilder builder = new SandboxDirectiveBuilder(); //Act builder.AllowModals(); builder.AllowTopNavigation(); builder.AllowPopups(); //Assert string result = builder.Build(); Assert.Equal("allow-modals allow-popups allow-top-navigation", result); }
public void SomethingElseCalled_OnlyNoneReturned() { //Arrange SandboxDirectiveBuilder builder = new SandboxDirectiveBuilder(); //Act builder.AllowForms(); builder.AllowModals(); builder.AllowNone(); builder.AllowAny(); //Assert string result = builder.Build(); Assert.Equal("'none'", result); }