Ejemplo n.º 1
0
        public void GetBrokenRulesMissingUserTest()
        {
            var task = new Domain.Task.Task
            {
                Id   = Guid.NewGuid(),
                Name = "test",
                Time = DateTime.Now
            };

            var spec   = new TaskUserRequired();
            var broken = spec.GetBrokenRules(task);

            Assert.IsTrue(broken.Any());
            Assert.AreEqual(1, broken.Count());
            Assert.AreEqual(TaskBusinessRules.TaskUserRequired.Description, broken.First().Description);
        }
Ejemplo n.º 2
0
        public void GetBrokenRulesValidInputTest()
        {
            var task = new Domain.Task.Task
            {
                Id   = Guid.NewGuid(),
                Name = "test",
                Time = DateTime.Now,
                User = new Domain.User.User {
                    Id = Guid.NewGuid()
                }
            };

            var spec   = new TaskUserRequired();
            var broken = spec.GetBrokenRules(task);

            Assert.IsTrue(!broken.Any());
        }