public void Index_ValidUrlHasNoOrders_ShowError() { // Arrange string url = "http://test.com"; _mockBookMarkletHelper.Setup(r => r.IsValidUrl(url)).Returns(true); _controller.MockCurrentUser(_dsc.Id, _dsc.UserName); // Act var result = _controller.Index(url) as ViewResult; // Assert result.Should().NotBeNull(); result.ViewName.Should().Be("Error"); }
public void TestInitialize() { _mockRepository = new Mock <IOrdersRepository>(); _mockMapper = new Mock <IMapper>(); var mockUnitOfWork = new Mock <IUnitOfWork>(); _mockQueueStore = new Mock <IQueueStore>(); mockUnitOfWork.SetupGet(u => u.Orders).Returns(_mockRepository.Object); _mockBookMarkletHelper = new Mock <IBookMarkletHelper>(); _controller = new BookMarkletController(mockUnitOfWork.Object, _mockMapper.Object, _mockQueueStore.Object, _mockBookMarkletHelper.Object); _userId = "1"; _userName = "******"; _controller.MockCurrentUser(_userId, _userName); }