コード例 #1
0
        public IDownloadSlotsViewModel CreateDownloadSlotsViewModel(Download download)
        {
            IDownloadSlotsViewModel downloadSlotsViewModel =
                new DownloadSlotsViewModel(download, downloadingClientFactory, fileStreamClientFactory);

            return(downloadSlotsViewModel);
        }
コード例 #2
0
        protected override void Establish_context()
        {
            base.Establish_context();

            DownloadSlotsModel = new Mock <IDownloadSlotsModel>();

            NetworkClientFactory = new Mock <INetworkClientFactory>();
            NetworkClient        = new Mock <INetworkClient>();
            NetworkClientFactory.Setup(clientFactory => clientFactory.CreateClient(It.IsAny <IUriSource>()))
            .Returns(NetworkClient.Object);

            FileStreamClientFactory = new Mock <IFileStreamClientFactory>();
            FileStreamClient        = new Mock <IFileStreamClient>();
            FileStreamClientFactory.Setup(clientFactory => clientFactory.CreateFileStreamClient(It.IsAny <IFilePathSource>()))
            .Returns(FileStreamClient.Object);

            List <DownloadSlot> downloadSlots = this.createDownloadSlots();

            DownloadSlotsModel.SetupGet(slotsModel => slotsModel.DownloadSlots).Returns(downloadSlots);
            DownloadSlotsViewModel = new DownloadSlotsViewModel(DownloadSlotsModel.Object,
                                                                NetworkClientFactory.Object, FileStreamClientFactory.Object);
        }
コード例 #3
0
 public void Then_downloads_in_slots_view_model_should_be_started()
 {
     DownloadSlotsViewModel.Verify(slots => slots.StartDownloading());
 }
コード例 #4
0
 public void Then_downloading_should_be_stopped()
 {
     DownloadSlotsViewModel.Verify(slots => slots.StopDownloading());
 }
コード例 #5
0
 protected override void Because_of()
 {
     DownloadSlotsViewModel.StartDownloading();
 }
コード例 #6
0
 protected override void Because_of()
 {
     DownloadSlotsViewModel.TryInitialize();
 }