public void BeforeEachTestmethod() { _currentUser = new ApplicationUser { Id = "12345" }; _otherUser = new ApplicationUser { Id = "67890" }; _fakeApplicationDbContext = new FakeApplicationDbContext(); _fakeApplicationDbContext.Users.Add(_currentUser); _fakeApplicationDbContext.Users.Add(_otherUser); _mockCurrentUserService = new Mock<ICurrentUserService>(); _mockCurrentUserService.Setup(x => x.UserId).Returns(_currentUser.Id); }
public void BeforeEachTestmethod() { _currentUser = new ApplicationUser { Id = "12345" }; _otherUser = new ApplicationUser { Id = "67890" }; _fakeApplicationDbContext = new FakeApplicationDbContext(); _fakeApplicationDbContext.Users.Add(_currentUser); _fakeApplicationDbContext.Users.Add(_otherUser); _mockCurrentUserService = new Mock<ICurrentUserService>(); _mockCurrentUserService.Setup(x => x.UserId).Returns(_currentUser.Id); _mockIDistanceCalculatorService = new Mock<IDistanceCalculatorService>(); _mockIDistanceCalculatorService.Setup(x => x.GetDistance(It.IsAny<Address>(), It.IsAny<Address>(), It.IsAny<Mode>(), It.IsAny<Units>())) .Returns(42); }