Beispiel #1
0
        public async Task updating_a_non_existing_context_on_an_existing_capability_throws_exception()
        {
            var capability = new CapabilityBuilder()
                             .Build();
            var sut = new CapabilityApplicationServiceBuilder()
                      .WithCapabilityRepository(new StubCapabilityRepository(capability))
                      .Build();

            var nonExistingContextId = Guid.Empty;
            var dummyAccountId       = "111111111111";
            var dummyEmail           = "*****@*****.**";
            var dummyArn             = "mynameisarne";


            await Assert.ThrowsAsync <ContextDoesNotExistException>(() =>
                                                                    sut.UpdateContext(capability.Id, nonExistingContextId, dummyAccountId, dummyArn, dummyEmail));
        }
Beispiel #2
0
        public async Task updating_a_existing_context_on_an_existing_capability()
        {
            var context    = new Context(Guid.NewGuid(), "default");
            var capability = new CapabilityBuilder()
                             .WithContexts(context)
                             .Build();

            var sut = new CapabilityApplicationServiceBuilder()
                      .WithCapabilityRepository(new StubCapabilityRepository(capability))
                      .Build();

            var newAccountId = "111111111111";
            var newEmail     = "*****@*****.**";
            var newRoleArn   = "mynameisarne";

            await sut.UpdateContext(capability.Id, context.Id, newAccountId, newRoleArn, newEmail);

            var contextFromCapability = capability.Contexts.Single();

            Assert.Equal(contextFromCapability.AWSAccountId, newAccountId);
            Assert.Equal(contextFromCapability.AWSRoleArn, newRoleArn);
            Assert.Equal(contextFromCapability.AWSRoleEmail, newEmail);
        }