コード例 #1
0
        public async void GetAsync_ReturnsTask()
        {
            var newGuid = _fixture.Create <Guid>();
            var dbTask  = _fixture.Create <DbTask>();

            var expected = new TaskDomain
            {
                Priority    = dbTask.Priority,
                State       = dbTask.State,
                AddedDate   = dbTask.AddedDate,
                DueDate     = dbTask.DueDate,
                Description = dbTask.Description,
                Id          = dbTask.Id
            };

            _dbRepository.Setup(x => x.GetByIdAsync(newGuid)).Returns(Task.FromResult(dbTask)).Verifiable();
            var actual = await _tasksRepository.GetAsync(newGuid);

            actual.Should().BeEquivalentTo(expected);
            _dbRepository.VerifyAll();
        }