Ejemplo n.º 1
0
        public void VerifyThatCurrentReferenceSourceDoesNotAppearInListOfPossibleReferenceSources()
        {
            var siteRdl = new SiteReferenceDataLibrary()
            {
                ShortName = "GenericRDL"
            };
            var publishedInReferenceSource = new ReferenceSource()
            {
                ShortName = "somebook", Iid = Guid.NewGuid()
            };

            siteRdl.ReferenceSource.Add(publishedInReferenceSource);
            siteRdl.ReferenceSource.Add(this.referenceSource);

            var openRdls = new List <ReferenceDataLibrary> {
                siteRdl
            };

            this.session.Setup(x => x.OpenReferenceDataLibraries).Returns(openRdls);

            this.viewmodel = new ReferenceSourceDialogViewModel(this.referenceSource, this.transaction, this.session.Object, true, ThingDialogKind.Create, null, null, null);
            Assert.AreEqual(1, this.viewmodel.PossiblePublishedIn.Count);

            Assert.IsFalse(this.viewmodel.PossiblePublishedIn.Any(x => x.Iid == this.referenceSource.Iid));
        }
Ejemplo n.º 2
0
        public void VerifyThatPossibleContainerRdlsGetPopulated()
        {
            var siteRdl = new SiteReferenceDataLibrary()
            {
                ShortName = "GenericRDL"
            };

            this.siteDirectory.SiteReferenceDataLibrary.Add(siteRdl);

            var modelRdl = new ModelReferenceDataLibrary()
            {
                ShortName = "ModelRDL"
            };

            modelRdl.RequiredRdl = siteRdl;

            var openRdls = new List <ReferenceDataLibrary> {
                siteRdl, modelRdl
            };

            this.session.Setup(x => x.OpenReferenceDataLibraries).Returns(openRdls);

            this.viewmodel = new ReferenceSourceDialogViewModel(this.referenceSource, this.transaction, this.session.Object, true, ThingDialogKind.Create, null, null, null);
            Assert.AreEqual(2, this.viewmodel.PossibleContainer.Count);

            Assert.AreEqual(siteRdl.ShortName, ((SiteReferenceDataLibrary)this.viewmodel.Container).ShortName);
        }
Ejemplo n.º 3
0
        public void VerifyThatWhenOrganizationsExistsTheDialogViewModelGetsPopulated()
        {
            var organization = new Organization()
            {
                ShortName = "RHEA"
            };

            this.siteDirectory.Organization.Add(organization);

            this.viewmodel = new ReferenceSourceDialogViewModel(this.referenceSource, this.transaction, this.session.Object, true, ThingDialogKind.Create, null, null, null);
            Assert.AreEqual(1, this.viewmodel.PossiblePublisher.Count);
        }
Ejemplo n.º 4
0
        public void VerifyThatTheLanguageCodesArePopulated()
        {
            var siteRdl = new SiteReferenceDataLibrary()
            {
                ShortName = "GenericRDL"
            };

            var openRdls = new List <ReferenceDataLibrary> {
                siteRdl
            };

            this.session.Setup(x => x.OpenReferenceDataLibraries).Returns(openRdls);

            this.referenceSource.Language = "blah";
            this.viewmodel = new ReferenceSourceDialogViewModel(this.referenceSource, this.transaction, this.session.Object, true, ThingDialogKind.Create, null, null, null);

            CollectionAssert.IsNotEmpty(this.viewmodel.PossibleLanguage);

            Assert.AreEqual("blah", this.viewmodel.Language);
        }
Ejemplo n.º 5
0
        public void VerifyThatPossiblePublishedInGetsPopulated()
        {
            var siteRdl = new SiteReferenceDataLibrary()
            {
                ShortName = "GenericRDL"
            };
            var publishedInReferenceSource = new ReferenceSource()
            {
                ShortName = "somebook"
            };

            siteRdl.ReferenceSource.Add(publishedInReferenceSource);

            var openRdls = new List <ReferenceDataLibrary> {
                siteRdl
            };

            this.session.Setup(x => x.OpenReferenceDataLibraries).Returns(openRdls);

            this.viewmodel = new ReferenceSourceDialogViewModel(this.referenceSource, this.transaction, this.session.Object, true, ThingDialogKind.Create, null, null, null);
            Assert.AreEqual(1, this.viewmodel.PossiblePublishedIn.Count);
        }
Ejemplo n.º 6
0
 public void VerifyThatAReferenceSourceDialogViewModelCanBeConstructed()
 {
     this.viewmodel = new ReferenceSourceDialogViewModel(this.referenceSource, this.transaction, this.session.Object, true, ThingDialogKind.Create, null, null, null);
     Assert.IsNotNull(this.viewmodel);
 }
Ejemplo n.º 7
0
 public void VerifyThatReferenceSourceDialogViewModelParameterlessConstructorExists()
 {
     this.viewmodel = new ReferenceSourceDialogViewModel();
     Assert.IsNotNull(this.viewmodel);
 }