예제 #1
0
        public async Task Should_fail_if_name_is_empty()
        {
            var mock   = CreateRepository("name1", "name2");
            var target = new TaskValidator(mock);
            var result = await target.ValidateAsync(new Entities.Task {
                Name = ""
            });

            Assert.False(result);
        }
예제 #2
0
        public async Task Should_pass_if_name_is_unique()
        {
            var mock   = CreateRepository("name1", "name2");
            var target = new TaskValidator(mock);
            var result = await target.ValidateAsync(new Entities.Task {
                Name = "name3"
            });

            Assert.True(result);
        }