Exemplo n.º 1
0
        public void GetByIdOriginalReturnsNullIfAssignmentWithIdNotFound()
        {
            BaseServiceTests.Initialize();

            var id = "NoSuchId";

            var repository = new DbRepository <Assignment>(this.dbFixture.dbContext);
            var service    = new AssignmentService(repository);

            var result = service.GetByIdOriginal(id);

            Assert.Null(result);
        }
Exemplo n.º 2
0
        public void GetByIdOriginalGetsAssignmentWithTheGivenId()
        {
            BaseServiceTests.Initialize();

            var id = this.dbFixture.dbContext.Assignments
                     .Where(l => l.IsDeleted == false).Select(l => l.Id).First();

            var repository = new DbRepository <Assignment>(this.dbFixture.dbContext);
            var service    = new AssignmentService(repository);

            var result = service.GetByIdOriginal(id);

            Assert.Equal(id, result.Id);
        }