예제 #1
0
        public void TestCreateNew()
        {
            IGitConfigurationRepository repo = new GitConfigurationRepository(database);
            var id  = Guid.NewGuid();
            var rsp = repo.CreateNew(new GitConnectionConfig {
                AccountName = "herocod3r", PersonalToken = "tos829", UserId = id
            });

            Assert.NotEqual(default(Guid), rsp.Id);
        }
예제 #2
0
        public void TestQuery()
        {
            IGitConfigurationRepository repo = new GitConfigurationRepository(database);
            var id  = Guid.NewGuid();
            var rsp = repo.CreateNew(new GitConnectionConfig {
                AccountName = "herocod3r", PersonalToken = "tos829", UserId = id
            });
            var item = repo.QueryAsync().Where(x => x.AccountName == "herocod3r").FirstOrDefault();

            Assert.NotNull(item);
        }
예제 #3
0
        public void TestGetById()
        {
            IGitConfigurationRepository repo = new GitConfigurationRepository(database);
            var id  = Guid.NewGuid();
            var rsp = repo.CreateNew(new GitConnectionConfig {
                AccountName = "herocod3r", PersonalToken = "tos829", UserId = id
            });
            var xitem = repo.GetById(rsp.Id);

            Assert.Equal(rsp.Id, xitem.Id);
        }
예제 #4
0
        public void TestDelete()
        {
            IGitConfigurationRepository repo = new GitConfigurationRepository(database);
            var id  = Guid.NewGuid();
            var rsp = repo.CreateNew(new GitConnectionConfig {
                AccountName = "herocod3r", PersonalToken = "tos829", UserId = id
            });

            rsp.AccountName = "jaytee";
            repo.Delete(rsp);

            var xitem = repo.GetById(rsp.Id);

            Assert.Null(xitem);
        }