public void TestGetById() { var serv = new GitConfigurationService(new GitConfigurationRepository(database)); var uid = Guid.NewGuid(); var item = serv.CreateNewAsync(uid, new Core.Data.Payloads.GitConfigPayload { AccountName = "jaytee", PersonalToken = "token", Type = "Github" }).Result; var itm = serv.GetById(item.Id, uid).Result; Assert.NotNull(itm); Assert.Equal(item.Id, itm.Id); }
public void TestDeleteAsync() { var serv = new GitConfigurationService(new GitConfigurationRepository(database)); var uid = Guid.NewGuid(); var item = serv.CreateNewAsync(uid, new Core.Data.Payloads.GitConfigPayload { AccountName = "jaytee", PersonalToken = "token", Type = "Github" }).Result; serv.DeleteAsync(uid, item.Id).Wait(); Assert.ThrowsAsync <DocIT.Core.Services.Exceptions.GitConfigException>(async() => await serv.GetById(item.Id, uid)); }