public void GetAllViewForaProperty()
        {
            //Now Arrange
            viewcontroller = Substitute.For <ViewingController>(_viewFactory, _handler);

            viewpropertymodel = new ViewPropertiesViewModel()
            {
                PropertyTitle = "test", ViewProperties = new List <BookViewingPropertyViewModel>()
                {
                    new BookViewingPropertyViewModel()
                    {
                        PropertyId = 1, PropertyTitle = "test", ViewingDateTime = DateTime.Now, BuyerId = "some guid"
                    }
                }
            };

            bookviewbilderparam = Substitute.For <BookViewingBuilderParam>();

            //Action
            var viewmodel = _viewFactory.GetViewModel <ViewingController, ViewPropertiesViewModel, BookViewingBuilderParam>(viewcontroller, bookviewbilderparam).Returns(viewpropertymodel);

            var actionsresult = viewcontroller.AllMyViewing(bookviewbilderparam);

            //Assert
            Assert.IsNotNull(viewmodel);

            Assert.IsNotInstanceOf <RedirectToRouteResult>(actionsresult);
        }
Beispiel #2
0
 public ViewProperties(ViewPropertiesViewModel viewModel)
 {
     InitializeComponent();
     DataContext = viewModel;
 }