コード例 #1
0
 public async Task NotDeleteOrganizationsThatDoNotMatchOrganizationIdOnCommand()
 {
     var command = new DeleteOrganization { Id = 999 };
     var handler = new DeleteOrganizationHandler(Context);
     await handler.Handle(command);
     Assert.Equal(2, Context.Organizations.Count());
 }
コード例 #2
0
 public async Task DeleteOrganizationThatMatchesOrganizationIdOnCommand()
 {
     var command = new DeleteOrganization { Id = 1 };
     var handler = new DeleteOrganizationHandler(Context);
     await handler.Handle(command);
     var data = Context.Organizations.Count(_ => _.Id == 1);
     Assert.Equal(0, data);
 }
コード例 #3
0
        public async Task DeleteTheOrganization()
        {
            var command = new DeleteOrganization { Id = 1 };

            var handler = new DeleteOrganizationHandler(Context);
            await handler.Handle(command);

            Assert.False(Context.Organizations.Any(x => x.Id == command.Id));
        }
コード例 #4
0
        public async Task DeleteTheOrganization()
        {
            var command = new DeleteOrganization {
                Id = 1
            };

            var handler = new DeleteOrganizationHandler(Context);
            await handler.Handle(command);

            Assert.False(Context.Organizations.Any(x => x.Id == command.Id));
        }