public void ShouldDelete() { Account account = new Account("*****@*****.**", "del", "del", "del", "del"); account = this.accounts.Create(account); this.accounts.Delete(account.Id); account = this.accounts.Read(account.Id); Assert.Null(account); }
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.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.accounts = new AccountRepository(context); this.messages = new ChatMessageRepository(context); this.sessions = new SessionRepository(context); // all other objects than 'message' are available thanks to a migration test database seed this.account = this.accounts.Read(1); this.session = this.sessions.Read(1); this.message = new ChatMessage(account.Id, session.Id, "some message", DateTime.Now); this.message = this.messages.Create(message); }
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 SetUp() { this.account = new Account("testemail", "testname", "testsurname", "testpicture", "testsecret"); this.accounts = new AccountRepository(new FakeContext()); this.account = this.accounts.Create(account); }
public void ShouldUpdate() { this.account = this.accounts.Read(this.account.Id); string name = "changedname"; string picture = "changedpicture"; string surname = "changedsurname"; this.account.Name = name; this.account.Picture = picture; this.account.Surname = surname; string unchangedEmail = this.account.Email; this.accounts.Update(account); this.account = this.accounts.Read(this.account.Id); Assert.AreEqual(this.account.Name, name); Assert.AreEqual(this.account.Picture, picture); Assert.AreEqual(this.account.Surname, surname); Assert.AreEqual(this.account.Email, unchangedEmail); }