Example #1
0
        public void GetCalendarsViaApiInterface()
        {
            MASchemaType maSchemaType = UnitTestControl.Schema[SchemaConstants.Calendar];

            ApiInterfaceCalendar u = new ApiInterfaceCalendar("my_customer", maSchemaType, UnitTestControl.TestParameters);

            BlockingCollection <object> items = new BlockingCollection <object>();

            u.GetObjectImportTask(UnitTestControl.MmsSchema, items, CancellationToken.None).Wait();
            HashSet <string> dns = new HashSet <string>();

            foreach (CSEntryChange item in items.OfType <CSEntryChange>())
            {
                //Assert.AreEqual(MAImportError.Success, item.ErrorCodeImport);
                //Assert.IsTrue(dns.Add(item.DN));
                foreach (AttributeChange c in item.AttributeChanges)
                {
                    foreach (ValueChange v in c.ValueChanges)
                    {
                        Type t = v.Value.GetType();

                        if (t != typeof(string) && t != typeof(long))
                        {
                            Debug.WriteLine($"{c.Name} - {v.Value.GetType()}");
                        }
                    }
                }
            }

            Assert.AreNotEqual(0, items.Count);
        }
        public void GetFeaturesViaApiInterface()
        {
            MASchemaType s = UnitTestControl.Schema[SchemaConstants.Feature];

            ApiInterfaceFeature u = new ApiInterfaceFeature("my_customer", s, UnitTestControl.TestParameters);

            BlockingCollection <object> items = new BlockingCollection <object>();

            u.GetObjectImportTask(UnitTestControl.MmsSchema, items, CancellationToken.None).Wait();

            foreach (CSEntryChange item in items.OfType <CSEntryChange>())
            {
                Assert.AreEqual(MAImportError.Success, item.ErrorCodeImport);
            }

            Assert.AreNotEqual(0, items.Count);
        }