Beispiel #1
0
        public async Task can_create_capability_with_an_acceptable_name(string input)
        {
            var sut = new CapabilityApplicationServiceBuilder()
                      .WithCapabilityRepository(new StubCapabilityRepository())
                      .Build();

            await sut.CreateCapability(input, string.Empty);
        }
Beispiel #2
0
        public async Task can_create_capability_with_an_acceptable_description(string input)
        {
            var sut = new CapabilityApplicationServiceBuilder()
                      .WithCapabilityRepository(new StubCapabilityRepository())
                      .Build();

            await sut.CreateCapability("AName", input);
        }
Beispiel #3
0
        public async Task cannot_create_capabilities_with_invalid_names(string input)
        {
            var sut = new CapabilityApplicationServiceBuilder()
                      .WithCapabilityRepository(new StubCapabilityRepository())
                      .Build();

            await Assert.ThrowsAsync <CapabilityValidationException>(() => sut.CreateCapability(input, string.Empty));
        }
Beispiel #4
0
        public async Task throws_exception_with_underscore_in_name()
        {
            var sut = new CapabilityApplicationServiceBuilder()
                      .WithCapabilityRepository(new StubCapabilityRepository())
                      .WithCapabilityFactory(new CapabilityFactory())
                      .Build();

            var dummyName = "A_Name";

            await Assert.ThrowsAsync <CapabilityValidationException>(() => sut.CreateCapability(dummyName, string.Empty));
        }