예제 #1
0
        public async Task GetEntriesAsync_ValidBackend_ReturnsEntriesFromBackend()
        {
            var entries = new List <CommandEntry> {
                new CommandEntry()
                {
                    Name = "1"
                }, new CommandEntry()
                {
                    Name = "2"
                }
            };

            backend.GetEntriesAsync().Returns(entries);
            var entryController = new EntryController(backend);
            var contentResult   =
                await entryController.GetEntriesAsync().ConfigureAwait(false) as
                OkNegotiatedContentResult <IEnumerable <CommandEntry> >;

            Assert.That(contentResult, Is.Not.Null);
            Assert.That(contentResult.Content, Is.EquivalentTo(entries));
        }