Beispiel #1
0
        public void ThrowNotFoundException()
        {
            // Arrange
            GetAccountCategoryQueryHandler handler = new GetAccountCategoryQueryHandler(_Database);
            GetAccountCategoryQuery        query   = new GetAccountCategoryQuery()
            {
                Id = 100
            };

            // Assert
            Assert.ThrowsAsync <NotFoundException> (() => handler.Handle(query, CancellationToken.None));
        }
Beispiel #2
0
        public async Task ReturnAccountCategory()
        {
            // Arrange
            GetAccountCategoryQueryHandler handler = new GetAccountCategoryQueryHandler(_Database);

            GetAccountCategoryQuery query = new GetAccountCategoryQuery()
            {
                Id = 10
            };

            // Act
            var result = await handler.Handle(query, CancellationToken.None);

            // Assert
            Assert.Equal(10, result.Id);
        }