示例#1
0
        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);
        }
示例#2
0
        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));
        }