コード例 #1
0
        public async Task GetTopics_ServiceInvoke()
        {
            //Act
            await _topicController.GetTopics();

            //Assert
            _topicServiceMock.Verify(s => s.GetTopics());
        }
コード例 #2
0
        public void GetTopics_ReturnSuccess()
        {
            _topics.Sort(new TopicComparer());
            _topics.Reverse();
            var expected = new OkObjectResult(_topics).Value;
            var actual   = ((OkObjectResult)_topicController.GetTopics().Result).Value;

            Assert.AreEqual(expected, actual);
        }