public async Task EstimateEventAsync_Valid()
        {
            //Arrange
            _mockUserManager.Setup(x => x.GetUserIdAsync(It.IsAny <User>()))
            .ReturnsAsync(fakeIdString);
            _mockParticipantManager.Setup(x =>
                                          x.EstimateEventByParticipantAsync(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <double>()))
            .ReturnsAsync(testEstimate);
            _mockRepositoryWrapper.Setup(x =>
                                         x.Event.GetFirstAsync(It.IsAny <Expression <Func <DataAccess.Entities.Event.Event, bool> > >(), null))
            .ReturnsAsync(new DataAccess.Entities.Event.Event());

            //Act
            var result = await _actionManager.EstimateEventAsync(testEventId, new User(), testEstimate);

            //Assert
            Assert.AreEqual(StatusCodes.Status200OK, result);
        }
Example #2
0
        public async Task <IActionResult> EstimateEvent(int id, double estimate)
        {
            var result = await _actionManager.EstimateEventAsync(id, await _userManager.GetUserAsync(User), estimate);

            return(Ok(result));
        }