public void FailToAddTheSameAddressTwice() { //Arrange Entry entryOne = new Entry() { Url = "manuelweb.at" }; Entry entryTwo = new Entry() { Url = "www.manuelweb.at" }; Entry entryThree = new Entry() { Url = "www.manuelweb.at" }; SetupUnlockedRunningApplication(); SpecificProfileView profileView = CreateTestableProfileView(); //Act Action firstAdd = () => { profileView.AddNewEntry(entryOne); }; Action secondAdd = () => { profileView.AddNewEntry(entryTwo); }; Action thirdAdd = () => { profileView.AddNewEntry(entryThree); }; //Assert firstAdd.Should().NotThrow <NewEntryException>(); secondAdd.Should().NotThrow <NewEntryException>(); thirdAdd.Should().Throw <NewEntryException>(); }
private void CreateProfileViewWithAddedEnAndDisabledEntry() { _profileView = CreateTestableProfileView(); _activatedEntry = Entry.CreateBlockEntry("manuelweb.at", true, true); _disabledEntry = Entry.CreateBlockEntry("www.manuelweb.at", true, true, false); _profileView.AddNewEntry(_activatedEntry); _profileView.AddNewEntry(_disabledEntry); }
public SpecificProfileView CreateTestableProfileView() { Profile profile = Profile.CreateProfile("Manuelweb", true, true); Application.UI.MainView.UserConfiguration.ProfileList.Add(profile); SpecificProfileView profileView = new SpecificProfileView("Manuelweb"); return(profileView); }