public void TestIndexerSuccess()
        {
            CompositeDataSupport data = CreareSampleData();

            Assert.AreEqual(1, data["Name1"]);
            Assert.AreEqual(1.2, data["Name2"]);
        }
示例#2
0
        /// <exception cref="System.Exception"/>
        private static void CheckMxBean()
        {
            CompositeDataSupport ruBean = GetBean();

            Assert.AssertNotEquals(0l, ruBean.Get("startTime"));
            NUnit.Framework.Assert.AreEqual(0l, ruBean.Get("finalizeTime"));
        }
        public void TestContainsValue()
        {
            CompositeDataSupport data = CreareSampleData();

            Assert.IsTrue(data.ContainsValue(1));
            Assert.IsTrue(data.ContainsValue(1.2));
            Assert.IsFalse(data.ContainsValue(true));
        }
        public void TestContainsKey()
        {
            CompositeDataSupport data = CreareSampleData();

            Assert.IsTrue(data.ContainsKey("Name1"));
            Assert.IsTrue(data.ContainsKey("Name2"));
            Assert.IsFalse(data.ContainsKey("Name3"));
        }
        public void TestGetAllSuccess()
        {
            CompositeDataSupport data   = CreareSampleData();
            IList <object>       values = data.GetAll(new string[] { "Name1", "Name2" });

            Assert.AreEqual(2, values.Count);
            Assert.IsTrue(values.Contains(1));
            Assert.IsTrue(values.Contains(1.2));
        }
示例#6
0
        public void AddNestedRow(int outerId, int innerId, string name)
        {
            var nestedCompositeValue = new CompositeDataSupport(_nestedCompositeValueType,
                                                                new[] { "NestedItem1", "NestedItem2" },
                                                                new object[] { "1", 5.7 });
            var compositeValue = new CompositeDataSupport(_compositeValueType, new[] { "Item1", "Item2", "Item3" },
                                                          new object[] { 1, false, nestedCompositeValue });
            var innerRow = new CompositeDataSupport(_innerTabularType.RowType, new[] { "ID", "Name", "CompositeValue" },
                                                    new object[] { outerId, name, compositeValue });
            var innerTable = new TabularDataSupport(_innerTabularType);

            innerTable.Put(innerRow);
            var outerRow = new CompositeDataSupport(_outerTabularType.RowType, new[] { "ID", "Value" },
                                                    new object[] { innerId, innerTable });

            _nestedTabularValue.Put(outerRow);
        }
 public void TestIndexerFailure()
 {
     CompositeDataSupport data = CreareSampleData();
     object o = data["Name3"];
 }
 public void TestConstructorFailureInvalidItemCount()
 {
     CompositeDataSupport data = new CompositeDataSupport(_sampleType, new string[] { "Name1" }, new object[] { 1 });
 }
 public void TestConstructorFailureItemDataNotValid()
 {
     CompositeDataSupport data = new CompositeDataSupport(_sampleType, new string[] { "Name1", "Name2" }, new object[] { 1, true });
 }
 public void TestConstructorFailureInvalidItemCount()
 {
     CompositeDataSupport data = new CompositeDataSupport(_sampleType, new string[] { "Name1" }, new object[] { 1 });
 }
示例#11
0
 public void TestConstructorFailureNotEqualSizes()
 {
     CompositeDataSupport data = new CompositeDataSupport(_sampleType, new string[] { "Name1", "Name2" }, new object[] { 1 });
 }
示例#12
0
        /// <exception cref="System.Exception"/>
        private static void CheckMxBeanIsNull()
        {
            CompositeDataSupport ruBean = GetBean();

            NUnit.Framework.Assert.IsNull(ruBean);
        }
 public void TestConstructorFailureNotEqualSizes()
 {
     CompositeDataSupport data = new CompositeDataSupport(_sampleType, new string[] {"Name1", "Name2"}, new object[] {1});
 }
 public void TestConstructorFailureNoSuchItem()
 {
     CompositeDataSupport data = new CompositeDataSupport(_sampleType, new string[] { "Name1", "Name3" }, new object[] { 1, 1.2 });
 }
 public void TestConstructorFailureItemDataNotValid()
 {
     CompositeDataSupport data = new CompositeDataSupport(_sampleType, new string[] { "Name1", "Name2" }, new object[] { 1, true });
 }
示例#16
0
 public void TestGetAllFailure()
 {
     CompositeDataSupport data   = CreareSampleData();
     IList <object>       values = data.GetAll(new string[] { "Name1", "Name2", "Name3" });
 }
示例#17
0
 public void TestConstructorFailureNoSuchItem()
 {
     CompositeDataSupport data = new CompositeDataSupport(_sampleType, new string[] { "Name1", "Name3" }, new object[] { 1, 1.2 });
 }