public void ShouldDelete() { Theme theme = new Theme("delname", "deldescr", this.organisation.Id, this.account.Id, "del;de;d"); theme = this.themes.Create(theme); this.themes.Delete(theme.Id); theme = this.themes.Read(theme.Id); Assert.Null(theme); }
public void SetUp() { FakeContext context = new FakeContext(); this.themes = new ThemeRepository(context); this.selectioncards = new SelectionCardRepository(context); // all other objects than 'selectioncard' are available thanks to a migration test database seed this.theme = this.themes.Read(1); this.selectioncard = new SelectionCard("testimage", "some text", this.theme.Id); this.selectioncard = this.selectioncards.Create(selectioncard); }
public void SetUp() { FakeContext context = new FakeContext(); this.organisations = new OrganisationRepository(context); this.subthemes = new SubthemeRepository(context); this.themes = new ThemeRepository(context); // all other objects than 'subtheme' are available thanks to a migration test database seed this.organisation = this.organisations.Read(1); this.theme = this.themes.Read(1); this.subtheme = new Subtheme("NUnitMasterRace", this.organisation.Id, this.theme.Id); this.subtheme = this.subthemes.Create(subtheme); }
public void SetUp() { FakeContext context = new FakeContext(); this.accounts = new AccountRepository(context); this.organisations = new OrganisationRepository(context); this.themes = new ThemeRepository(context); // all other objects than 'theme' are available thanks to a migration test database seed this.account = this.accounts.Read(1); this.organisation = this.organisations.Read(1); this.theme = new Theme("testname", "descr", this.organisation.Id, this.account.Id, "tags;tag;ta;t"); this.theme = this.themes.Create(theme); }
public void OneTimeSetUp() { this.accounts = FakeServiceFactory.Create<Account>(); this.organisations = FakeServiceFactory.Create<Organisation>(); this.sessions = FakeServiceFactory.Create<Session>(); this.subthemes = FakeServiceFactory.Create<Subtheme>(); this.themes = FakeServiceFactory.Create<Theme>(); this.unauthorized = "unauthorizedusersecret"; this.authorized = "authorizedusersecret"; Account account1 = new Account("*****@*****.**", "name1", "surname1", "picture1", this.authorized) { Organisations = new List<Organisation>(), OrganisedSessions = new List<Session>(), ParticipatingSessions = new List<Session>(), Subthemes = new List<Subtheme>(), Themes = new List<Theme>() }; account1 = this.accounts.Add(account1); Account account2 = new Account("*****@*****.**", "name2", "surname2", "picture2", this.unauthorized); account2 = this.accounts.Add(account2); Organisation organisation = new Organisation("name", account1.Id) { Sessions = new List<Session>(), Themes = new List<Theme>() }; organisation = this.organisations.Add(organisation); account1.Organisations.Add(organisation); this.accounts.Change(account1); Theme theme = new Theme("name", "descr", organisation.Id, organisation.OrganiserId, "tag") { Subthemes = new List<Subtheme>() }; theme = this.themes.Add(theme); organisation.Themes.Add(theme); this.organisations.Change(organisation); account1.Themes.Add(theme); this.accounts.Change(account1); Subtheme subtheme = new Subtheme("name", theme.OrganiserId, theme.Id) { Sessions = new List<Session>() }; subtheme = this.subthemes.Add(subtheme); theme.Subthemes.Add(subtheme); this.themes.Change(theme); account1.Subthemes.Add(subtheme); this.accounts.Change(account1); Session session = new Session(true, 0, "descr", false, 10, 10, organisation.Id, 0, subtheme.Id, DateTime.Now, DateTime.Now.AddDays(5)) { Organisers = new List<Account>(), Participants = new List<Account>() }; session = this.sessions.Add(session); subtheme.Sessions.Add(session); this.subthemes.Change(subtheme); account1.OrganisedSessions.Add(session); session.Organisers.Add(account1); account1.ParticipatingSessions.Add(session); session.Participants.Add(account1); this.accounts.Change(account1); this.sessions.Change(session); }
public void ShouldUpdate() { this.theme = this.themes.Read(this.theme.Id); string name = "new name"; string tags = "new;tags;yo"; this.theme.Name = name; this.theme.Tags = tags; this.themes.Update(theme); this.theme = this.themes.Read(this.theme.Id); Assert.AreEqual(this.theme.Name, name); Assert.AreEqual(this.theme.Tags, tags); }