예제 #1
0
        public async Task <IActionResult> Index()
        {
            var publishers = await publisherLookupDataService.GetPublisherLookupAsync(nameof(PublishersViewModel));

            var vm = new PublishersViewModel()
            {
                Publishers = publishers
            };

            return(View(vm));
        }
예제 #2
0
        public PublishersViewModelTests()
        {
            eventAggregatorMock        = new Mock <IEventAggregator>();
            publisherLookupServiceMock = new Mock <IPublisherLookupDataService>();

            publisherLookupServiceMock.Setup(dp => dp.GetPublisherLookupAsync(nameof(PublisherDetailViewModel)))
            .ReturnsAsync(new List <LookupItem>
            {
                new LookupItem {
                    Id = Guid.NewGuid(), DisplayMember = "Publisher 1"
                },
                new LookupItem {
                    Id = Guid.NewGuid(), DisplayMember = "The Second Publisher"
                }
            });

            viewModel = new PublishersViewModel(eventAggregatorMock.Object, publisherLookupServiceMock.Object);
        }
예제 #3
0
 public PublishersPage()
 {
     InitializeComponent();
     DataContext = new PublishersViewModel();
 }