CSharpTest.Net
Filters Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Commands Namespace > CommandInterpreter Class : Filters Property

Glossary Item Box

Lists all the filters that have been added to the interpreter

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Filters As ICommandFilter()
C# 
public ICommandFilter[] Filters {get;}

Example

Library/Library.Test/TestCmdInterpreter.cs

C#Copy Code
string result;
CommandInterpreter ci = new CommandInterpreter(DefaultCommands.None, new TestCommands(), typeof(StaticTestFilter));
Assert.AreEqual(1, ci.Filters.Length);
Assert.AreEqual("AddLineNumbers", ci.Filters[0].DisplayName);

result = Capture(ci, "Count 2 /linenumbers");
Assert.AreEqual("1: 1\r\n2: 2", result);

int cmds = ci.Commands.Length;
ci.AddCommand(ci.Filters[0]);
Assert.AreEqual(cmds + 1, ci.Commands.Length);

result = Capture(ci, "AddLineNumbers");
Assert.AreEqual("2", result);
VB.NETCopy Code
Dim result As String
Dim ci As New CommandInterpreter(DefaultCommands.None, New TestCommands(), GetType(StaticTestFilter))
Assert.AreEqual(1, ci.Filters.Length)
Assert.AreEqual("AddLineNumbers", ci.Filters(0).DisplayName)

result = Capture(ci, "Count 2 /linenumbers")
Assert.AreEqual("1: 1" & vbCr & vbLf & "2: 2", result)

Dim cmds As Integer = ci.Commands.Length
ci.AddCommand(ci.Filters(0))
Assert.AreEqual(cmds + 1, ci.Commands.Length)

result = Capture(ci, "AddLineNumbers")
Assert.AreEqual("2", result)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys