Exemplo n.º 1
0
        public async Task <Item> CreateAsync(Item item)
        {
            var currentTime = _dateTimeWrapper.CurrentDateTime();
            var id          = _guidWrapper.GenerateGuid();
            var newItem     = new Item
            {
                Id             = id,
                Text           = item.Text,
                CreationTime   = currentTime,
                LastUpdateTime = currentTime
            };

            return(await _repository.CreateAsync(newItem));
        }
Exemplo n.º 2
0
 private void MockWrappers(Guid id, DateTime currentTime)
 {
     _dateTimeWrapper.CurrentDateTime().Returns(currentTime, DateTime.MinValue);
     _guidWrapper.GenerateGuid().Returns(id, Guid.Empty);
 }