public void PreviewReturnsErrorIfPresentationDoesNotExist() { MDatabaseContext.AllInstances.PresentationExistsInt32 = (i, g) => false; MDatabaseContext.AllInstances.GetPresentationInt32 = (i, g) => null; var controller = new GalleryController(); var result = controller.Preview(1); Assert.AreEqual("Error", result.ViewName); }
public void PreviewReturnsPresentationIfPresentationExists() { var presentation = new SPresentation(){PresentationId = 1}; MDatabaseContext.AllInstances.PresentationExistsInt32 = (i, g) => true; MDatabaseContext.AllInstances.GetPresentationInt32 = (i, g) => presentation; var controller = new GalleryController(); var result = controller.Preview(1); Assert.AreNotEqual("Error", result.ViewName); }