示例#1
0
        public void TestUpdateEvaluation_Succesful_Update()
        {
            var service     = new EvaluationsService(new EvaluationsStubDao());
            var evaluations = service.GetEvaluations();
            var actual      = evaluations[0];
            var expected    = new Evaluation {
                Id = actual.Id, Name = "Updated name"
            };

            service.UpdateEvaluation(expected);

            Assert.Equal(expected.Name, actual.Name);
        }
示例#2
0
        public void TestUpdateEvaluationWithEditDate_Throws_InternalErrorDaoException()
        {
            var mockEvaluation = new Evaluation()
            {
                Id       = Guid.Parse("11111111-1111-1111-1111-111111111114"),
                Name     = "New Evaluation",
                EditDate = DateTime.Now
            };

            var expected = "Bad arguments, cannot update existing evaluation Edit Date";

            try
            {
                var service = new EvaluationsService(new EvaluationsStubDao());
                service.UpdateEvaluation(mockEvaluation);
            }
            catch (Exception e)
            {
                Assert.Equal(expected, e.Message);
            }
        }