Example #1
0
        public void TestCreateGitConfig()
        {
            var serv = new GitConfigurationService(new GitConfigurationRepository(database));
            var item = serv.CreateNewAsync(Guid.NewGuid(), new Core.Data.Payloads.GitConfigPayload {
                AccountName = "jaytee", PersonalToken = "token", Type = "Github"
            }).Result;

            Assert.NotNull(item);
            Assert.NotEqual(default(Guid), item.Id);
        }
Example #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));
        }
Example #3
0
        public void TestListAll()
        {
            var serv = new GitConfigurationService(new GitConfigurationRepository(database));
            var uid  = Guid.NewGuid();
            var val  = serv.CreateNewAsync(uid, new Core.Data.Payloads.GitConfigPayload {
                AccountName = "jaytee", PersonalToken = "token", Type = "Github"
            }).Result;
            var items = serv.ListAllForUser(uid);

            Assert.NotEmpty(items.Result);
        }
Example #4
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);
        }