public void Setup()
 {
     this.disposable1            = new Mock <IDisposable>();
     this.disposable2            = new Mock <IDisposable>();
     this.disposableReactiveList = new DisposableReactiveList <IDisposable> {
         this.disposable1.Object, this.disposable2.Object
     };
 }
        public void SetUp()
        {
            RxApp.MainThreadScheduler = Scheduler.CurrentThread;
            this.permissionService    = new Mock <IPermissionService>();
            this.thingCreator         = new Mock <IThingCreator>();
            this.cache = new ConcurrentDictionary <CacheKey, Lazy <Thing> >();

            this.serviceLocator = new Mock <IServiceLocator>();

            ServiceLocator.SetLocatorProvider(() => this.serviceLocator.Object);

            this.serviceLocator.Setup(x => x.GetInstance <IThingCreator>())
            .Returns(this.thingCreator.Object);

            this.modelsetup     = new EngineeringModelSetup(Guid.NewGuid(), this.cache, this.uri);
            this.iterationsetup = new IterationSetup(Guid.NewGuid(), this.cache, this.uri);

            this.modelsetup.IterationSetup.Add(this.iterationsetup);

            this.session = new Mock <ISession>();

            this.model = new EngineeringModel(Guid.NewGuid(), this.cache, this.uri)
            {
                EngineeringModelSetup = this.modelsetup
            };
            this.iteration = new Iteration(Guid.NewGuid(), this.cache, this.uri)
            {
                IterationSetup = this.iterationsetup
            };
            var person = new Person(Guid.NewGuid(), null, null)
            {
                GivenName = "test", Surname = "test"
            };

            this.session.Setup(x => x.ActivePerson).Returns(person);

            this.model.Iteration.Add(this.iteration);

            this.session.Setup(x => x.PermissionService).Returns(this.permissionService.Object);
            this.session.Setup(x => x.OpenIterations).Returns(new Dictionary <Iteration, Tuple <DomainOfExpertise, Participant> >());

            this.fileStoreRow  = new Mock <IFileStoreRow <FileStore> >();
            this.containedRows = new DisposableReactiveList <IRowViewModelBase <Thing> >();
            this.fileStoreRow.Setup(x => x.ContainedRows).Returns(this.containedRows);
            this.fileStoreRow.Setup(x => x.Session).Returns(this.session.Object);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads the <see cref="FileType"/>s from the cache when the browser is instantiated.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            this.FileTypes = new DisposableReactiveList <FileTypeRowViewModel>();
            var openDataLibrariesIids = this.Session.OpenReferenceDataLibraries.Select(y => y.Iid);

            foreach (var referenceDataLibrary in this.Thing.AvailableReferenceDataLibraries()
                     .Where(x => openDataLibrariesIids.Contains(x.Iid)))
            {
                foreach (var filetype in referenceDataLibrary.FileType)
                {
                    this.AddFileTypeRowViewModel(filetype);
                }
            }

            this.CreateCommand = ReactiveCommand.Create(this.WhenAnyValue(x => x.CanWriteFileType));
            this.CreateCommand.Subscribe(_ => this.ExecuteCreateCommand <FileType>());
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes the dialogs
 /// </summary>
 protected override void Initialize()
 {
     base.Initialize();
     this.Values = new DisposableReactiveList <Dialogs.SimpleParameterValueRowViewModel>();
 }
 /// <summary>
 /// Initializes the dialogs
 /// </summary>
 protected override void Initialize()
 {
     base.Initialize();
     this.Values = new DisposableReactiveList <Dialogs.RequirementsContainerParameterValueRowViewModel>();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes the browser
 /// </summary>
 protected override void Initialize()
 {
     base.Initialize();
     this.RuleVerificationListRowViewModels = new DisposableReactiveList <RuleVerificationListRowViewModel>();
 }