示例#1
0
        public async Task When_ValuesIsCalled_Expect_AllValuesToRepository()
        {
            // Arrange
            var expectValues = new List <Value> {
                new Value {
                    Id           = new Guid(),
                    DateCreated  = new DateTime(),
                    DateModified = new DateTime(),
                    Title        = "Title",
                    Message      = "Message"
                }
            };

            // Expectations
            _valueRepositoryMock.Setup(x => x.FindAll()).Returns(Task.FromResult(expectValues));

            // Act
            var result = await _sut.GetValuesAsync();

            // Assert
            Assert.Equal(result.Count, 1);
            Assert.Equal(result, expectValues);
        }