public void RedlistCriteriaStringTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.RedlistCriteria;

            Assert.IsTrue(actual.Length > 5);
        }
        public void SpeciesInformationDocumentConstructor1Test()
        {
            Data.ArtDatabankenService.SpeciesFactList speciesFacts = GetTargetSpeciesFacts();
            SpeciesInformationDocument target = new SpeciesInformationDocument(speciesFacts);

            Assert.IsNotNull(target);
        }
        public void ExtraParagraphTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.ExtraParagraph;

            Assert.IsTrue(actual != String.Empty);
        }
        public void MeasuresParagraphTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.MeasuresParagraph;

            Assert.IsTrue(actual.Length > 0);
        }
        public void ItalicStringsInReferencesTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            List <String> list = target.ItalicStringsInReferences;

            Assert.IsTrue(list.Count > 0);
        }
        public void ReferenceParagraphTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.ReferenceParagraph;

            Assert.IsTrue(actual.Length > 50);
        }
        public void CommonNameTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.CommonName;

            Assert.IsTrue(actual == "hasselsnok");
        }
        public void PreambleParagraphTest()
        {
            SpeciesInformationDocument target = new SpeciesInformationDocument(100046); //vitryggig hackspett
            String actual = target.PreambleParagraph;

            Assert.IsTrue(actual.Length > 50);
        }
        public void ScientificNameTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.ScientificName;

            Assert.IsTrue(actual == "Coronella austriaca");
        }
        public void IsPublishable()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            Boolean isPublishable             = target.IsPublishable;

            Assert.IsTrue(isPublishable);
        }
        public void AuthorAndYearTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.AuthorAndYear;

            Assert.IsTrue(actual.Length > 10);
        }
        public void SpeciesFactsTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();

            Data.ArtDatabankenService.SpeciesFactList list = target.SpeciesFacts;
            Assert.IsNotNull(list);
        }
        public void DescriptionParagraphTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.DescriptionParagraph;

            Assert.IsTrue(actual.Length > 100);
        }
        public void OrganismGroupTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual   = target.OrganismGroup;
            String expected = "Grod- och kräldjur";

            Assert.AreEqual(actual, expected);
        }
        public void UpdateDateMaxValueTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            DateTime test   = DateTime.MinValue;
            DateTime actual = target.UpdateDateMaxValue;

            Assert.IsTrue(actual > test);
        }
        public void TaxonTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();

            ArtDatabanken.Data.ArtDatabankenService.Taxon actual = target.Taxon;
            Assert.IsTrue(actual.ScientificName == target.ScientificName);
            Assert.IsTrue(actual.CommonName == target.CommonName);
        }
        public void ThreatsParagraphTest()
        {
            Data.ArtDatabankenService.SpeciesFactList speciesFacts = GetTargetSpeciesFacts();
            SpeciesInformationDocument target = new SpeciesInformationDocument(speciesFacts);
            string actual = target.ThreatsParagraph;

            Assert.IsTrue(actual.Length > 50);
        }
        public void RedlistCategoryNameTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            String actual = target.RedlistCategoryName;

            Assert.IsTrue(actual.Length > 0);
            Assert.IsTrue(actual.Length < 200);
        }
        public void UpdateDateMinValueTest()
        {
            SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
            DateTime today  = DateTime.Today;
            DateTime actual = target.UpdateDateMinValue;

            Assert.IsTrue(actual < today);
        }
 private Data.ArtDatabankenService.SpeciesFactList GetTargetSpeciesFacts()
 {
     if (_targetSpeciesFacts.IsNull())
     {
         SpeciesInformationDocument target = GetTargetSpeciesInformationDocument();
         _targetSpeciesFacts = target.SpeciesFacts;
     }
     return(_targetSpeciesFacts);
 }
        //
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        private SpeciesInformationDocument GetTargetSpeciesInformationDocument()
        {
            Int32 taxonId = 100041; //Hasselsnok

            if (_targetSpeciesInformationDocument.IsNull())
            {
                _targetSpeciesInformationDocument = new SpeciesInformationDocument(taxonId);
            }
            return(_targetSpeciesInformationDocument);
        }
        public void AutomaticTaxonomicParagraphTest()
        {
            SpeciesInformationDocument target = new SpeciesInformationDocument(100768);
            String actual = target.AutomaticTaxonomicParagraph;

            Assert.IsTrue(actual.Length > 50);
            Int32 pos = actual.IndexOf("Cucullia scrophulariae");

            Assert.IsTrue(pos > 0);
        }
Esempio n. 23
0
        public void SaveFileTest()
        {
            //Int32 taxonId = 101656; //trumgräshoppa
            Int32 taxonId = 100046; // vitrygg
            SpeciesInformationDocument document = new SpeciesInformationDocument(GetUserContext(), taxonId);

            SpeciesInformationDocumentWriter writer = new SpeciesInformationDocumentWriter(document);

            Assert.IsNotNull(writer);

            ///The code below is recommended for debug only.

            /*
             * String fileName = "TestPdfWriter.pdf";
             * if (File.Exists(fileName))
             * {
             *  File.Delete(fileName);
             * }
             * writer.SavePdf(fileName);
             *
             * Process.Start(fileName);
             * */
        }
 public SpeciesInformationDocumentTest()
 {
     _targetSpeciesFacts = null;
     _targetSpeciesInformationDocument = null;
 }
        public void SpeciesInformationDocumentConstructor2Test()
        {
            SpeciesInformationDocument target = new SpeciesInformationDocument(BEAR_TAXON_ID);

            Assert.IsNotNull(target);
        }