Ejemplo n.º 1
0
        public async Task Test_Add_ReturnsValidObject()
        {
            var mockOdd    = GenerateOddMock();
            var mockOddDto = GenerateOddDtoMock();
            var id         = Guid.NewGuid();
            var valuesId   = Guid.NewGuid();

            mockOdd.Id           = id;
            mockOdd.OddValues.Id = valuesId;

            _oddsRepository.AddAsync <Odd>(Arg.Any <Odd>()).Returns(Task.FromResult(mockOdd));

            var result = await sut.AddAsync(mockOddDto);

            Assert.IsInstanceOf <OddDto>(result);
            Assert.AreEqual(result.Id, id);
            Assert.AreEqual(result.OddValues.Id, valuesId);
        }
Ejemplo n.º 2
0
 public async Task <OddDto> AddAsync(OddDto dto)
 {
     return(Map(await _oddsRepository.AddAsync(InverseMap(dto))));
 }