public void WidgetApplicationRegisterWidgetInfo()
        {
            tlog.Debug(tag, $"WidgetApplicationRegisterWidgetInfo START");

            Widget widget = new Widget();

            var testingTarget = new WidgetApplication(widget.GetIntPtr(), false);
            Assert.IsNotNull(testingTarget, "Can't create success object WidgetApplication");
            Assert.IsInstanceOf<WidgetApplication>(testingTarget, "Should be an instance of WidgetApplication type.");

            global::System.Collections.Generic.Dictionary<Type, string> widgetInfo = new global::System.Collections.Generic.Dictionary<Type, string>(){
                { typeof(Widget), "*****@*****.**"} };

            try
            {
                testingTarget.RegisterWidgetInfo(widgetInfo);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception: Failed!");
            }

            widget.Dispose();
            widget = null;

            testingTarget.Dispose();
            testingTarget = null;
            tlog.Debug(tag, $"WidgetApplicationRegisterWidgetInfo END (OK)");
        }
        public void WidgetApplicationAddWidgetInstance()
        {
            tlog.Debug(tag, $"WidgetApplicationAddWidgetInstance START");

            Widget widget = new Widget();

            var testingTarget = new WidgetApplication(widget.GetIntPtr(), false);
            Assert.IsNotNull(testingTarget, "Can't create success object WidgetApplication");
            Assert.IsInstanceOf<WidgetApplication>(testingTarget, "Should be an instance of WidgetApplication type.");

            try
            {
                testingTarget.AddWidgetInstance(widget);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception: Failed!");
            }

            widget.Dispose();
            widget = null;

            testingTarget.Dispose();
            testingTarget = null;
            tlog.Debug(tag, $"WidgetApplicationAddWidgetInstance END (OK)");
        }
Exemple #3
0
        public void WidgetApplicationConstructorWithWidgetApplication()
        {
            tlog.Debug(tag, $"WidgetApplicationConstructorWithWidgetApplication START");

            Widget widget = new Widget();

            WidgetApplication widgetApplication = new WidgetApplication(widget.GetIntPtr(), false);

            Assert.IsNotNull(widgetApplication, "Can't create success object WidgetApplication");
            Assert.IsInstanceOf <WidgetApplication>(widgetApplication, "Should be an instance of WidgetApplication type.");

            var testingTarget = new WidgetApplication(widgetApplication);

            Assert.IsNotNull(testingTarget, "Can't create success object WidgetApplication");
            Assert.IsInstanceOf <WidgetApplication>(testingTarget, "Should be an instance of WidgetApplication type.");

            widget.Dispose();
            widget = null;

            widgetApplication.Dispose();
            widgetApplication = null;

            testingTarget.Dispose();
            testingTarget = null;
            tlog.Debug(tag, $"WidgetApplicationConstructorWithWidgetApplication END (OK)");
        }