示例#1
0
        public void ActionNameTest()
        {
            var service    = new DummyService <ActionNameTestClass> ();
            var controller = new ServiceController(new[] { new DummyServiceAction("foo") }, null);

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#2
0
        public void UnimplementedOptionalStateVariable()
        {
            var service    = new DummyService <OptionalStateVariablesClass> ();
            var controller = new ServiceController(null,
                                                   new[] { new DummyStateVariable("BarChanged", "string") });

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#3
0
        public void UnimplementedOptionalAction()
        {
            var service    = new DummyService <OptionalActionClass> ();
            var controller = new ServiceController(
                new[] { new DummyServiceAction("Bar", new [] { new Argument("bar", "A_ARG_bar", ArgumentDirection.In) }) },
                new[] { new StateVariable("A_ARG_bar", "string") });

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#4
0
        public void StateVariableIsMulticastTest()
        {
            var service    = new DummyService <StateVariableIsMulticastTestClass> ();
            var controller = new ServiceController(null,
                                                   new[] {
                new DummyStateVariable("FooChanged", "string", true)
            }
                                                   );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#5
0
 public void ArgumentTest ()
 {
     var service = new DummyService<ArgumentTestClass> ();
     var controller = new ServiceController (
         new[] {
             new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) })
         },
         new[] {
             new StateVariable ("A_ARG_bar", "string")
         }
     );
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#6
0
        public void RelatedStateVariableDataTypeTest()
        {
            var service    = new DummyService <RelatedStateVariableDataTypeTestClass> ();
            var controller = new ServiceController(
                new[] {
                new DummyServiceAction("Foo", new[] { new Argument("bar", "A_ARG_bar", ArgumentDirection.In) })
            },
                new[] {
                new StateVariable("A_ARG_bar", "string.foo")
            }
                );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#7
0
        public void EventedRelatedStateVariableTest()
        {
            var service    = new DummyService <EventedRelatedStateVariableTestClass> ();
            var controller = new ServiceController(
                new[] {
                new DummyServiceAction("GetFoo", new[] { new Argument("foo", "Foo", ArgumentDirection.Out) })
            },
                new[] {
                new DummyStateVariable("Foo", "string")
            }
                );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#8
0
        public void RelatedStateVariableAllowedValueRangeTest()
        {
            var service    = new DummyService <RelatedStateVariableAllowedValueRangeTestClass> ();
            var controller = new ServiceController(
                new[] {
                new DummyServiceAction("Foo", new[] { new Argument("bar", "A_ARG_bar", ArgumentDirection.In) })
            },
                new[] {
                new StateVariable("A_ARG_bar", "i4", new AllowedValueRange("0", "100", "2"))
            }
                );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#9
0
        public void EnumArgumentNameTest()
        {
            var service    = new DummyService <EnumArgumentNameTestClass> ();
            var controller = new ServiceController(
                new[] {
                new DummyServiceAction("Foo", new[] { new Argument("bar", "A_ARG_bar", ArgumentDirection.In) })
            },
                new[] {
                new StateVariable("A_ARG_bar", new[] { "foo", "bar" })
            }
                );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#10
0
        public void ReturnArgumentRelatedStateVariableNameTest()
        {
            var service    = new DummyService <ReturnArgumentRelatedStateVariableNameTestClass> ();
            var controller = new ServiceController(
                new[] {
                new DummyServiceAction("Foo", new[] { new Argument("result", "X_ARG_foo", ArgumentDirection.Out, true) })
            },
                new[] {
                new StateVariable("X_ARG_foo", "string")
            }
                );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#11
0
        public void RelatedStateVariableAllowedValuesConflictTest3()
        {
            var service    = new DummyService <RelatedStateVariableAllowedValuesConflictTest3Class> ();
            var controller = new ServiceController(
                new[] {
                new DummyServiceAction("Foo", new[] { new Argument("bar", "A_ARG_bar", ArgumentDirection.In) }),
                new DummyServiceAction("Bar", new[] { new Argument("bar", "A_ARG_Bar_bar", ArgumentDirection.In) })
            },
                new[] {
                new StateVariable("A_ARG_bar", new[] { "Foo", "Bar" }),
                new StateVariable("A_ARG_Bar_bar", new[] { "foo", "bar" })
            }
                );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#12
0
        public void ArgumentTypeConflictTest()
        {
            var service    = new DummyService <ArgumentTypeConflictTestClass> ();
            var controller = new ServiceController(
                new[] {
                new DummyServiceAction("Foo", new[] { new Argument("bar", "A_ARG_bar", ArgumentDirection.In) }),
                new DummyServiceAction("Bar", new[] { new Argument("bar", "A_ARG_Bar_bar", ArgumentDirection.In) })
            },
                new[] {
                new StateVariable("A_ARG_bar", "string"),
                new StateVariable("A_ARG_Bar_bar", "i4")
            }
                );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#13
0
        public void ArgumentsTest()
        {
            var service    = new DummyService <ArgumentsTestClass> ();
            var controller = new ServiceController(
                new[] {
                new DummyServiceAction("Foo", new[] {
                    new Argument("stringArg", "A_ARG_stringArg", ArgumentDirection.In),
                    new Argument("intArg", "A_ARG_intArg", ArgumentDirection.In),
                    new Argument("byteArg", "A_ARG_byteArg", ArgumentDirection.In),
                    new Argument("ushortArg", "A_ARG_ushortArg", ArgumentDirection.In),
                    new Argument("uintArg", "A_ARG_uintArg", ArgumentDirection.In),
                    new Argument("sbyteArg", "A_ARG_sbyteArg", ArgumentDirection.In),
                    new Argument("shortArg", "A_ARG_shortArg", ArgumentDirection.In),
                    new Argument("longArg", "A_ARG_longArg", ArgumentDirection.In),
                    new Argument("floatArg", "A_ARG_floatArg", ArgumentDirection.In),
                    new Argument("doubleArg", "A_ARG_doubleArg", ArgumentDirection.In),
                    new Argument("charArg", "A_ARG_charArg", ArgumentDirection.In),
                    new Argument("dateTimeArg", "A_ARG_dateTimeArg", ArgumentDirection.In),
                    new Argument("boolArg", "A_ARG_boolArg", ArgumentDirection.In),
                    new Argument("byteArrayArg", "A_ARG_byteArrayArg", ArgumentDirection.In),
                    new Argument("uriArg", "A_ARG_uriArg", ArgumentDirection.In)
                })
            },
                new[] {
                new StateVariable("A_ARG_stringArg", "string"),
                new StateVariable("A_ARG_intArg", "i4"),
                new StateVariable("A_ARG_byteArg", "ui1"),
                new StateVariable("A_ARG_ushortArg", "ui2"),
                new StateVariable("A_ARG_uintArg", "ui4"),
                new StateVariable("A_ARG_sbyteArg", "i1"),
                new StateVariable("A_ARG_shortArg", "i2"),
                new StateVariable("A_ARG_longArg", "int"),
                new StateVariable("A_ARG_floatArg", "r4"),
                new StateVariable("A_ARG_doubleArg", "r8"),
                new StateVariable("A_ARG_charArg", "char"),
                new StateVariable("A_ARG_dateTimeArg", "date"),
                new StateVariable("A_ARG_boolArg", "boolean"),
                new StateVariable("A_ARG_byteArrayArg", "bin"),
                new StateVariable("A_ARG_uriArg", "uri")
            }
                );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#14
0
        public void StateVariablesTest()
        {
            var service    = new DummyService <StateVariablesTestClass> ();
            var controller = new ServiceController(null,
                                                   new[] {
                new DummyStateVariable("StringChanged", "string"),
                new DummyStateVariable("IntChanged", "i4"),
                new DummyStateVariable("ByteChanged", "ui1"),
                new DummyStateVariable("UshortChanged", "ui2"),
                new DummyStateVariable("UintChanged", "ui4"),
                new DummyStateVariable("SbyteChanged", "i1"),
                new DummyStateVariable("ShortChanged", "i2"),
                new DummyStateVariable("LongChanged", "int"),
                new DummyStateVariable("FloatChanged", "r4"),
                new DummyStateVariable("DoubleChanged", "r8"),
                new DummyStateVariable("CharChanged", "char"),
                new DummyStateVariable("BoolChanged", "boolean"),
                new DummyStateVariable("ByteArrayChanged", "bin"),
                new DummyStateVariable("UriChanged", "uri")
            }
                                                   );

            ServiceDescriptionTests.AssertEquality(controller, service.GetController());
        }
示例#15
0
 public void RelatedStateVariableAllowedValuesConflictTest3 ()
 {
     var service = new DummyService<RelatedStateVariableAllowedValuesConflictTest3Class> ();
     var controller = new ServiceController (
         new[] {
             new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) }),
             new DummyServiceAction ("Bar", new[] { new Argument ("bar", "A_ARG_Bar_bar", ArgumentDirection.In) })
         },
         new[] {
             new StateVariable ("A_ARG_bar", new[] { "Foo", "Bar" }),
             new StateVariable ("A_ARG_Bar_bar", new[] { "foo", "bar" })
         }
     );
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#16
0
 public void ArgumentsTest ()
 {
     var service = new DummyService<ArgumentsTestClass> ();
     var controller = new ServiceController (
         new[] {
             new DummyServiceAction ("Foo", new[] {
                 new Argument ("stringArg", "A_ARG_stringArg", ArgumentDirection.In),
                 new Argument ("intArg", "A_ARG_intArg", ArgumentDirection.In),
                 new Argument ("byteArg", "A_ARG_byteArg", ArgumentDirection.In),
                 new Argument ("ushortArg", "A_ARG_ushortArg", ArgumentDirection.In),
                 new Argument ("uintArg", "A_ARG_uintArg", ArgumentDirection.In),
                 new Argument ("sbyteArg", "A_ARG_sbyteArg", ArgumentDirection.In),
                 new Argument ("shortArg", "A_ARG_shortArg", ArgumentDirection.In),
                 new Argument ("longArg", "A_ARG_longArg", ArgumentDirection.In),
                 new Argument ("floatArg", "A_ARG_floatArg", ArgumentDirection.In),
                 new Argument ("doubleArg", "A_ARG_doubleArg", ArgumentDirection.In),
                 new Argument ("charArg", "A_ARG_charArg", ArgumentDirection.In),
                 new Argument ("dateTimeArg", "A_ARG_dateTimeArg", ArgumentDirection.In),
                 new Argument ("boolArg", "A_ARG_boolArg", ArgumentDirection.In),
                 new Argument ("byteArrayArg", "A_ARG_byteArrayArg", ArgumentDirection.In),
                 new Argument ("uriArg", "A_ARG_uriArg", ArgumentDirection.In)
             })
         },
         new[] {
             new StateVariable ("A_ARG_stringArg", "string"),
             new StateVariable ("A_ARG_intArg", "i4"),
             new StateVariable ("A_ARG_byteArg", "ui1"),
             new StateVariable ("A_ARG_ushortArg", "ui2"),
             new StateVariable ("A_ARG_uintArg", "ui4"),
             new StateVariable ("A_ARG_sbyteArg", "i1"),
             new StateVariable ("A_ARG_shortArg", "i2"),
             new StateVariable ("A_ARG_longArg", "int"),
             new StateVariable ("A_ARG_floatArg", "r4"),
             new StateVariable ("A_ARG_doubleArg", "r8"),
             new StateVariable ("A_ARG_charArg", "char"),
             new StateVariable ("A_ARG_dateTimeArg", "date"),
             new StateVariable ("A_ARG_boolArg", "boolean"),
             new StateVariable ("A_ARG_byteArrayArg", "bin"),
             new StateVariable ("A_ARG_uriArg", "uri")
         }
     );
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#17
0
 public void StateVariablesTest ()
 {
     var service = new DummyService<StateVariablesTestClass> ();
     var controller = new ServiceController (null,
         new[] {
             new DummyStateVariable ("StringChanged", "string"),
             new DummyStateVariable ("IntChanged", "i4"),
             new DummyStateVariable ("ByteChanged", "ui1"),
             new DummyStateVariable ("UshortChanged", "ui2"),
             new DummyStateVariable ("UintChanged", "ui4"),
             new DummyStateVariable ("SbyteChanged", "i1"),
             new DummyStateVariable ("ShortChanged", "i2"),
             new DummyStateVariable ("LongChanged", "int"),
             new DummyStateVariable ("FloatChanged", "r4"),
             new DummyStateVariable ("DoubleChanged", "r8"),
             new DummyStateVariable ("CharChanged", "char"),
             new DummyStateVariable ("BoolChanged", "boolean"),
             new DummyStateVariable ("ByteArrayChanged", "bin"),
             new DummyStateVariable ("UriChanged", "uri")
         }
     );
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#18
0
 public void RelatedStateVariableAllowedValueRangeTest ()
 {
     var service = new DummyService<RelatedStateVariableAllowedValueRangeTestClass> ();
     var controller = new ServiceController (
         new[] {
             new DummyServiceAction ("Foo", new[] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) })
         },
         new[] {
             new StateVariable ("A_ARG_bar", "i4", new AllowedValueRange ("0", "100", "2"))
         }
     );
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#19
0
 public void ImplementedOptionalStateVariable ()
 {
     var service = new DummyService<OptionalStateVariablesClass> (new OptionalStateVariablesClass { HasFoo = true });
     var controller = new ServiceController (null,
         new[] {
             new DummyStateVariable ("FooChanged", "string"),
             new DummyStateVariable ("BarChanged", "string") });
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#20
0
 public void ImplementedOptionalAction ()
 {
     var service = new DummyService<OptionalActionClass> (new OptionalActionClass { CanFoo = true });
     var controller = new ServiceController (
         new[] {
             new DummyServiceAction ("Foo", new [] { new Argument ("foo", "A_ARG_foo", ArgumentDirection.In) }),
             new DummyServiceAction ("Bar", new [] { new Argument ("bar", "A_ARG_bar", ArgumentDirection.In) })
         },
         new[] {
             new StateVariable ("A_ARG_foo", "string"),
             new StateVariable ("A_ARG_bar", "string") });
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#21
0
 public void EventedRelatedStateVariableTest ()
 {
     var service = new DummyService<EventedRelatedStateVariableTestClass> ();
     var controller = new ServiceController (
         new[] {
             new DummyServiceAction ("GetFoo", new[] { new Argument ("foo", "Foo", ArgumentDirection.Out) })
         },
         new[] {
             new DummyStateVariable ("Foo", "string")
         }
     );
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#22
0
 public void ActionNameTest ()
 {
     var service = new DummyService<ActionNameTestClass> ();
     var controller = new ServiceController (new[] { new DummyServiceAction ("foo") }, null);
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#23
0
 public void ReturnArgumentRelatedStateVariableNameTest ()
 {
     var service = new DummyService<ReturnArgumentRelatedStateVariableNameTestClass> ();
     var controller = new ServiceController (
         new[] {
             new DummyServiceAction ("Foo", new[] { new Argument ("result", "X_ARG_foo", ArgumentDirection.Out, true) })
         },
         new[] {
             new StateVariable ("X_ARG_foo", "string")
         }
     );
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }
示例#24
0
 public void StateVariableIsMulticastTest ()
 {
     var service = new DummyService<StateVariableIsMulticastTestClass> ();
     var controller = new ServiceController (null,
         new[] {
             new DummyStateVariable ("FooChanged", "string", true)
         }
     );
     ServiceDescriptionTests.AssertEquality (controller, service.GetController ());
 }