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); }
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); }
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); }
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); }