コード例 #1
0
        public void Setup()
        {
            this.navigation       = new Mock <IThingDialogNavigationService>();
            this.permissionServce = new Mock <IPermissionService>();
            this.cache            = new ConcurrentDictionary <CacheKey, Lazy <Thing> >();

            this.session      = new Mock <ISession>();
            this.siteDir      = new SiteDirectory(Guid.NewGuid(), this.cache, null);
            this.organization = new Organization()
            {
                Name = "organization", ShortName = "orga"
            };

            this.clone = this.siteDir.Clone(false);
            this.cache.TryAdd(new CacheKey(this.siteDir.Iid, null), new Lazy <Thing>(() => this.siteDir));

            var transactionContext = TransactionContextResolver.ResolveContext(this.siteDir);

            this.transaction = new ThingTransaction(transactionContext, this.clone);

            var dal = new Mock <IDal>();

            this.session.Setup(x => x.DalVersion).Returns(new Version(1, 1, 0));
            this.session.Setup(x => x.Dal).Returns(dal.Object);
            dal.Setup(x => x.MetaDataProvider).Returns(new MetaDataProvider());

            this.viewmodel = new OrganizationDialogViewModel(this.organization, this.transaction, this.session.Object, true, ThingDialogKind.Create, this.navigation.Object, this.clone);
        }
コード例 #2
0
        public void VerifyThatDefaultConstructorDoesNotThrowException()
        {
            var organizationDialogViewModel = new OrganizationDialogViewModel();

            Assert.IsNotNull(organizationDialogViewModel);
        }