コード例 #1
0
        public void ApoClassServiceReturnNullWhenIdNotExist()
        {
            var service = new ApoClassService(_apoClassRepository, _apoDepartmentRepository);

            var sut = service.GetById(2000000);


            Assert.Null(sut);
        }
コード例 #2
0
        public void ApoClassServiceReturnCorrectId()
        {
            var service       = new ApoClassService(_apoClassRepository, _apoDepartmentRepository);
            var selectedClass = Mapper.Map <ApoClassDto>(_apoClass.Single(x => x.Id == 2));

            selectedClass.DepartmentName = _apoDepartment.Single(x => x.Id == selectedClass.DepartmentId).Name;

            var sut = service.GetById(2);


            AssertObjects.PropertyValuesAreEquals(sut, selectedClass);
        }