Ejemplo n.º 1
0
        public void FindRepoTest()
        {
            var service = new RepoService(_dbContext, _projectService.Object);

            var repo = service.FindRepo(1);

            Assert.AreEqual(1, repo.Result.Id);
            Assert.AreEqual("MarioKart", repo.Result.Name);
        }
Ejemplo n.º 2
0
        public void CreateRepoTest()
        {
            var service  = new RepoService(_dbContext, _projectService.Object);
            var fakeUser = _dbContext.Users.FirstOrDefault(user => user.UserName == "Mario");

            service.CreateRepo(fakeUser, 999, "RepoFromHell", "Test repo", "http://2ip.ru");

            var repo = service.FindRepo(999);

            Assert.AreEqual("RepoFromHell", repo.Result.Name);
            Assert.AreEqual("Test repo", repo.Result.Description);
        }