Пример #1
0
        public void NPPDExamplesTest03()
        {
            NPPD <PQ> ageRange = new NPPD <PQ>
                                 (
                new UVP <PQ>[] {}
                                 );

            ageRange.NullFlavor = null;
            Assert.IsFalse(ageRange.Validate());
        }
Пример #2
0
        public void NPPDExamplesTest02()
        {
            NPPD <PQ> ageRange = new NPPD <PQ>
                                 (
                new UVP <PQ>[] {
                new UVP <PQ>(new PQ(1, "a"), (decimal)0.1),
                new UVP <PQ>(new PQ(2, "a"), (decimal)0.2),
                new UVP <PQ>(new PQ(3, "a"), (decimal)0.45),
                new UVP <PQ>(new PQ(4, "a"), (decimal)0.1),
                new UVP <PQ>(new PQ(5, "a"), (decimal)0.15),
            }
                                 );

            ageRange.NullFlavor = NullFlavor.Other;
            Assert.IsFalse(ageRange.Validate());
        }
Пример #3
0
        public void R2NPPDParseTest()
        {
            // NPPD data
            NPPD <PQ> inti = new NPPD <PQ>
                             (
                new UVP <PQ>[] {
                new UVP <PQ>(new PQ(1, "a"), (decimal)0.1),
                new UVP <PQ>(new PQ(2, "a"), (decimal)0.2),
                new UVP <PQ>(new PQ(3, "a"), (decimal)0.45),
                new UVP <PQ>(new PQ(4, "a"), (decimal)0.1),
                new UVP <PQ>(new PQ(5, "a"), (decimal)0.15)
            }
                             );

            string actualXml = R2SerializationHelper.SerializeAsString(inti);
            var    int2      = R2SerializationHelper.ParseString <NPPD <PQ> >(actualXml);

            Assert.AreEqual(inti, int2);
        }
Пример #4
0
        public void NPPDExamplesTest01()
        {
            // create a new NPPD object
            NPPD <PQ> ageRange = new NPPD <PQ>
                                 (
                // give NPPD values to graph
                new UVP <PQ>[] {
                new UVP <PQ>(new PQ(1, "a"), (decimal)0.1),
                new UVP <PQ>(new PQ(2, "a"), (decimal)0.2),
                new UVP <PQ>(new PQ(3, "a"), (decimal)0.45),
                new UVP <PQ>(new PQ(4, "a"), (decimal)0.1),
                new UVP <PQ>(new PQ(5, "a"), (decimal)0.15),
            }
                                 );

            ageRange.NullFlavor = null;
            Console.WriteLine(ageRange.ToString());
            Assert.IsTrue(ageRange.Validate());
        }
Пример #5
0
        public void NPPDExamplesTest01()
        {
            // create a new NPPD object
            NPPD<PQ> ageRange = new NPPD<PQ>
                (
                    // give NPPD values to graph
                    new UVP<PQ>[] {
                        new UVP<PQ>(new PQ(1,"a"), (decimal)0.1),
                        new UVP<PQ>(new PQ(2,"a"), (decimal)0.2),
                        new UVP<PQ>(new PQ(3,"a"), (decimal)0.45),
                        new UVP<PQ>(new PQ(4,"a"), (decimal)0.1),
                        new UVP<PQ>(new PQ(5,"a"), (decimal)0.15),
                    }
                );

            ageRange.NullFlavor = null;
            Console.WriteLine(ageRange.ToString());
            Assert.IsTrue(ageRange.Validate());
        }
Пример #6
0
 public void NPPDExamplesTest03()
 {
     NPPD<PQ> ageRange = new NPPD<PQ>
         (
             new UVP<PQ>[] {}
         );
     ageRange.NullFlavor = null;
     Assert.IsFalse(ageRange.Validate());
 }
Пример #7
0
 public void NPPDExamplesTest02()
 {
     NPPD<PQ> ageRange = new NPPD<PQ>
         (
             new UVP<PQ>[] {
                 new UVP<PQ>(new PQ(1,"a"), (decimal)0.1),
                 new UVP<PQ>(new PQ(2,"a"), (decimal)0.2),
                 new UVP<PQ>(new PQ(3,"a"), (decimal)0.45),
                 new UVP<PQ>(new PQ(4,"a"), (decimal)0.1),
                 new UVP<PQ>(new PQ(5,"a"), (decimal)0.15),
             }
         );
     ageRange.NullFlavor = NullFlavor.Other;
     Assert.IsFalse(ageRange.Validate());
 }