public void Setup() { mockService = new Mock<ITaskBoardService>(); mockService = TaskBoardControllerTestsMockHelper.SetupUpServiceMocks(mockService); service = mockService.Object; controller = new TaskBoardController(service); }
public void Setup() { mockService = new Mock<ITaskBoardRepository>(); mockService = TaskBoardControllerTestsMockHelper.SetupUpServiceMocks(mockService); fakeProviderUserKey = Guid.NewGuid(); var userMock = new Mock<MembershipUser>(); userMock.Setup(u => u.ProviderUserKey).Returns(fakeProviderUserKey); userMock.Setup(u => u.UserName).Returns("kenn"); mockStaticMembershipService = new Mock<IStaticMembershipService>(); mockStaticMembershipService.Setup(x => x.GetUser()).Returns(userMock.Object); mockProfileFactoryService = new Mock<IProfileFactoryService>(); mockProfileFactoryService.Setup(x => x.GetUserProfile(It.IsAny<string>())).Returns(new UserProfile()); mockProfileFactoryService.Setup(x => x.GetPropertyValue(It.IsAny<string>(), It.IsAny<string>())).Returns("test value"); service = mockService.Object; controller = new TaskBoardController(service, mockStaticMembershipService.Object, mockProfileFactoryService.Object); }