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); }
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)); }
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)); }
/// <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)); }