コード例 #1
0
        public void Create()
        {
            var context = new Mock<IContextAware>();
            {
                context.Setup(c => c.IsSynchronized)
                    .Returns(true);
            }

            var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null);
            var plan = CreateNewDistributionPlan(
                new DatasetActivationProposal(),
                CreateOfflineInfo(new Mock<IPersistenceInformation>().Object),
                systemDiagnostics);

            var suggestion = new DistributionSuggestion(plan);

            var model = new MachineSelectorModel(
                context.Object,
                new List<DistributionSuggestion>
                    {
                        suggestion,
                    },
                new CurrentThreadTaskScheduler());

            Assert.IsNotNull(model.AvailableProposals);

            Assert.That(
                model.AvailableProposals,
                Is.EquivalentTo(
                    new List<DistributionSuggestion>
                    {
                        suggestion,
                    }));

            Assert.IsFalse(model.IsLoading);
        }
コード例 #2
0
        public void Create()
        {
            var context = new Mock <IContextAware>();
            {
                context.Setup(c => c.IsSynchronized)
                .Returns(true);
            }

            var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null);
            var plan = CreateNewDistributionPlan(
                new DatasetActivationProposal(),
                CreateOfflineInfo(new Mock <IPersistenceInformation>().Object),
                systemDiagnostics);

            var suggestion = new DistributionSuggestion(plan);

            var model = new MachineSelectorModel(
                context.Object,
                new List <DistributionSuggestion>
            {
                suggestion,
            },
                new CurrentThreadTaskScheduler());

            Assert.IsNotNull(model.AvailableProposals);

            Assert.That(
                model.AvailableProposals,
                Is.EquivalentTo(
                    new List <DistributionSuggestion>
            {
                suggestion,
            }));

            Assert.IsFalse(model.IsLoading);
        }