public void Init() { var userHubServie = new Mock <IUserHubService>(); userHubServie.Setup(t => t.GetAllUserHub()).Returns(new List <UserHub>() { new UserHub { HubID = 1, UserHubID = 1, UserProfileID = 1 } }); _userWarehouseController = new UserWarehouseController(userHubServie.Object); }
public void Init() { var userWarehouse = new List <UserHub> { new UserHub { UserHubID = 1, HubID = 1, UserProfileID = 1, IsDefault = "True" }, new UserHub { UserHubID = 2, HubID = 1, UserProfileID = 2, IsDefault = "False" } }; var userWarehouseService = new Mock <IUserHubService>(); userWarehouseService.Setup(m => m.GetAllUserHub()).Returns(userWarehouse); var hub = new List <Hub> { new Hub { HubID = 1, Name = "One", HubOwnerID = 1 }, new Hub { HubID = 2, Name = "Two", HubOwnerID = 2 }, }; var hubService = new Mock <IHubService>(); hubService.Setup(m => m.GetAllHub()).Returns(hub); var userProfile = new List <UserProfile> { new UserProfile { UserProfileID = 1, UserName = "******", Email = "*****@*****.**", LanguageCode = "en" }, new UserProfile { UserProfileID = 2, UserName = "******", Email = "*****@*****.**", LanguageCode = "am" } }; var userProfileService = new Mock <IUserProfileService>(); userProfileService.Setup(m => m.GetAllUserProfile()).Returns(userProfile); _userWarehouseController = new UserWarehouseController(userWarehouseService.Object, hubService.Object, userProfileService.Object); }