public void Test_Create_Invite_NotFound() { var userRepo = new UserRepository(database); var usr = userRepo.CreateNew(new User { DateCreated = DateTime.Now, Email = "*****@*****.**", Name = "Jaytee" }); var invRepo = new InviteRepository(database, userRepo); var project = invRepo.CreateNew(new Project { CreatedByUserId = usr.Id, DateCreated = DateTime.Now, Description = "A demo api", Name = "DEMO API" }); var service = new InviteService(invRepo); Assert.ThrowsAsync <DocIT.Core.Services.Exceptions.InviteException>(async() => await service.CreateInvite(new Core.Data.Payloads.InvitePayload { Email = "*****@*****.**", ProjectId = Guid.NewGuid() }, Guid.NewGuid())); }
public void TestCreateInvite() { var userRepo = new UserRepository(database); var usr = userRepo.CreateNew(new User { DateCreated = DateTime.Now, Email = "*****@*****.**", Name = "Jaytee" }); var invRepo = new InviteRepository(database, userRepo); var project = invRepo.CreateNew(new Project { CreatedByUserId = usr.Id, DateCreated = DateTime.Now, Description = "A demo api", Name = "DEMO API" }); var ivc = invRepo.CreateInvite(new Invite { Email = "*****@*****.**", InvitedAt = DateTime.Now }, project.Id, usr.Id); Assert.NotNull(ivc); Assert.NotEmpty(ivc.Invites); }
public void Test_Create_Invite() { var userRepo = new UserRepository(database); var usr = userRepo.CreateNew(new User { DateCreated = DateTime.Now, Email = "*****@*****.**", Name = "Jaytee" }); var invRepo = new InviteRepository(database, userRepo); var project = invRepo.CreateNew(new Project { CreatedByUserId = usr.Id, DateCreated = DateTime.Now, Description = "A demo api", Name = "DEMO API" }); var service = new InviteService(invRepo); var res = service.CreateInvite(new Core.Data.Payloads.InvitePayload { Email = "*****@*****.**", ProjectId = project.Id }, Guid.NewGuid()).Result; Assert.NotNull(res); }