public void ShouldDelete() { Organisation organisation = new Organisation("new and shiny", this.account.Id); organisation = this.organisations.Create(organisation); this.organisations.Delete(organisation.Id); organisation = this.organisations.Read(organisation.Id); Assert.Null(organisation); }
public void SetUp() { FakeContext context = new FakeContext(); this.accounts = new AccountRepository(context); this.organisations = new OrganisationRepository(context); // all other objects than 'organisation' are available thanks to a migration test database seed this.account = this.accounts.Read(1); this.organisation = new Organisation("NUnitMasterRace", this.account.Id); this.organisation = this.organisations.Create(organisation); }
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 SetUp() { FakeContext context = new FakeContext(); this.organisations = new OrganisationRepository(context); this.sessions = new SessionRepository(context); this.subthemes = new SubthemeRepository(context); // all other objects than 'session' are available thanks to a migration test database seed this.organisation = this.organisations.Read(1); this.subtheme = this.subthemes.Read(1); this.session = new Session(true, 0, "NUnitMasterRace", false, 10, 10, this.organisation.Id, 1, this.subtheme.Id, DateTime.Now, DateTime.Now.AddDays(2)); this.session = this.sessions.Create(session); }
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.organisation = this.organisations.Read(this.organisation.Id); string name = "changedname"; this.organisation.Name = name; this.organisations.Update(organisation); this.organisation = this.organisations.Read(this.organisation.Id); Assert.AreEqual(this.organisation.Name, name); }