private void GetAll() { mapper = new AutoMapperTest(); mapper.Reset(); mapper.IsValidConfiguration(); List <OnDuties> list = new List <OnDuties>(); MemberPreferences mp = new MemberPreferences(); var genericIdentity = new API.Authorization.User("4", true, "dummyUser", API.Authorization.User.IarUserTypes.User, "", "", DateTime.Now, 125625, 168); _mockUW.Setup(m => m.OnDutiesRepository.GetOnScheduleOnAsync(genericIdentity.SubscriberId)).ReturnsAsync(list); _mockUW.Setup(m => m.MemberPreferencesRepository.GetPreferencesByMemberIdAsync(genericIdentity.MemberId, (int)genericIdentity.UserType)).ReturnsAsync(mp); _controller = new OnDutiesController(_mockUW.Object, new ApplicationContext(genericIdentity)); var result = _controller.Get(); Assert.NotNull(result); }
public OnDutiesControllerTest() : base(unitOfWorkContext, applicationContext) { _controller = new OnDutiesController(_mockUW.Object, _mockAC.Object); }