public async Task Return_empty_list_if_there_are_no_commands_stored_in_database()
        {
            // arrange
            var request = new StaticCommandsLookup();

            MockCollection.Setup(x => x.GetAsync("staticContentCommands", null))
            .Throws <Exception>();

            // act
            var result = await _handler.Handle(request, CancellationToken.None);

            // assert
            Assert.That(result, Is.Not.Null);
            Assert.That(result.Commands == null || !result.Commands.Any(), Is.True);
        }
Example #2
0
        public async Task Return_empty_list_if_there_are_no_commands_stored_in_database()
        {
            // arrange
            var request = new StaticCommandsLookup();

            _mockBucket.Setup(x => x.GetAsync <ValidStaticCommands>("staticContentCommands"))
            .ReturnsAsync(new FakeOperationResult <ValidStaticCommands> {
                Success = false
            });

            // act
            var result = await _handler.Handle(request, CancellationToken.None);

            // assert
            Assert.That(result, Is.Not.Null);
            Assert.That(result.Commands == null || !result.Commands.Any(), Is.True);
        }