public void TestConstructor(string sendToPluginEvent, string sendToPropertyInspectorEvent)
        {
            // given, when
            var testCase = new PropertyInspectorMethodAttribute(sendToPluginEvent, sendToPropertyInspectorEvent);

            // then
            Assert.That(testCase.SendToPluginEvent, Is.EqualTo(sendToPluginEvent));
            Assert.That(testCase.SendToPropertyInspectorEvent, Is.EqualTo(sendToPropertyInspectorEvent));
        }
        public void TestConstructor()
        {
            // given, when
            var testCase = new PropertyInspectorMethodAttribute();

            // then
            Assert.That(testCase.SendToPluginEvent, Is.Empty);
            Assert.That(testCase.SendToPropertyInspectorEvent, Is.Empty);
        }
示例#3
0
        public void TestEventNames_None()
        {
            // given, when
            var attr     = new PropertyInspectorMethodAttribute();
            var testCase = this.GetAnyMethodInfo(attr, out var methodInfo);

            // then
            Assert.That(testCase.SendToPluginEvent, Is.EqualTo(methodInfo.Name));
            Assert.That(testCase.SendToPropertyInspectorEvent, Is.EqualTo(methodInfo.Name));
        }
示例#4
0
        public void TestEventNames_SendToPluginEventOnly()
        {
            // given
            const string sendToPluginEvent = "toPlugin";

            // when
            var attr     = new PropertyInspectorMethodAttribute(sendToPluginEvent);
            var testCase = this.GetAnyMethodInfo(attr, out var methodInfo);

            // then
            Assert.That(testCase.SendToPluginEvent, Is.EqualTo(sendToPluginEvent));
            Assert.That(testCase.SendToPropertyInspectorEvent, Is.EqualTo(sendToPluginEvent));
        }
示例#5
0
 /// <summary>
 /// Gets a <see cref="PropertyInspectorMethodInfo"/> that can be used for testing.
 /// </summary>
 /// <param name="attr">The attribute information.</param>
 /// <param name="methodInfo">The method information used to construct the result.</param>
 /// <returns>The <see cref="PropertyInspectorMethodInfo"/>.</returns>
 private PropertyInspectorMethodInfo GetAnyMethodInfo(PropertyInspectorMethodAttribute attr, out MethodInfo methodInfo)
 {
     methodInfo = typeof(FooStreamDeckAction).GetMethod(nameof(FooStreamDeckAction.PropertyInspector_AsyncResult));
     return(new PropertyInspectorMethodInfo(methodInfo, attr));
 }