Menu ▾ ▴

FinPlusTestBuilder

Anonymous Fin-Plus

Builds and runs component tests (see Testing).

  • Product bespoke alternative to JMock and NUnit.
  • Tests and stubs both service/client components, individualy or in complex configs.
  • Clone functionality and xml editing allows rapid test production pre release, providing comprehensive backward testing for future releases.
  • Test files can be checked into svn for further comparison and audit.
  • Events both client/service pass through a Command Router in function format, this provides a point of audit and capture/injection for Testing.

Note multi data with permissions, structure and data observability still to be factored in.


Example Application

  • Simple to run all tests, press the play button at the top followed by the clipboard button.
  • Very easy to create new tests, the clone button generates new tests (test name increments) and the link buttons edit.

Test run buttons.

  1. Play components to get result.
  2. Clipboard, compare result to expected.
  3. Test name, play and compare.

Build buttons for new test stubs.

  1. Database, new test data from db.
  2. Record adds config to window for command recording (events etc) for new test.
  3. Copy clones test, press link button to alter.
  4. Synchronize results to expected results.

Link buttons for editing/investigation.

  1. Notepad++ useful for simple configs.
  2. XmlNotepad useful for more complex configs.
  3. Svn diff, add and commit.

Other buttons.

  1. Erase, renames files with datetime extension.
  2. View, docks client component to window for visual testing.

Note you need to drop shortcuts in with .exe (notepad.lnk and xmlpad.lnk).


File types

Minimal required files.

Type Description
.stub Stub for services/views.
.log Logs interface re services/views.
.service Service to be tested.
.view Client to be tested.

Initial stubs created the easy way, by pushing a button.

Type Description
.data Initail component data.
.state User saved component states.
.cmds Client/Service events/commands.
.expected Check to result, sync for new test.

Generated file.

Type Description
.result Client state/values or service values.
(.service or .client) + .state + .data + .cmds(events)= .results = .expected = "Ok"

Example Files

Part of the cmd (events) file to inject for test.

    <_FilterbarUserName>
      <Item name="Id" value="FilterbarUserName" type="String" timestamp="30/11/2013 10:57:02" user="norton" />
      <Item name="FunctionName" value="FilterButton_Click" type="String" timestamp="30/11/2013 10:57:02" user="norton" />
      <Item name="TimeStamp" value="Unbooked" type="DateTime" timestamp="30/11/2013 10:57:02" user="norton" />
      <Item name="Tag" value="UserName" type="String" timestamp="30/11/2013 10:57:02" user="norton" />
      <Item name="Content" value="jon norton" type="String" timestamp="30/11/2013 10:57:02" user="norton" />
      <Item name="IsChecked" value="False" type="Boolean" timestamp="30/11/2013 10:57:02" user="norton" />
    </_FilterbarUserName>
    <_FilterbarUserId>
      <Item name="Id" value="FilterbarUserId" type="String" timestamp="30/11/2013 10:57:04" user="norton" />
      <Item name="FunctionName" value="FilterButton_Click" type="String" timestamp="30/11/2013 10:57:04" user="norton" />
      <Item name="TimeStamp" value="Unbooked" type="DateTime" timestamp="30/11/2013 10:57:04" user="norton" />
      <Item name="Tag" value="UserId" type="String" timestamp="30/11/2013 10:57:04" user="norton" />
      <Item name="Content" value="nortonj" type="String" timestamp="30/11/2013 10:57:04" user="norton" />
      <Item name="IsChecked" value="False" type="Boolean" timestamp="30/11/2013 10:57:04" user="norton" />
    </_FilterbarUserId>
    <_FilterbarUserId>
      <Item name="Id" value="FilterbarUserId" type="String" timestamp="30/11/2013 10:57:06" user="norton" />
      <Item name="FunctionName" value="FilterButton_Click" type="String" timestamp="30/11/2013 10:57:06" user="norton" />
      <Item name="TimeStamp" value="Unbooked" type="DateTime" timestamp="30/11/2013 10:57:06" user="norton" />
      <Item name="Tag" value="UserId" type="String" timestamp="30/11/2013 10:57:06" user="norton" />
      <Item name="Content" value="smithk" type="String" timestamp="30/11/2013 10:57:06" user="norton" />
      <Item name="IsChecked" value="False" type="Boolean" timestamp="30/11/2013 10:57:06" user="norton" />
    </_FilterbarUserId>

Part of the result file.

    <_FiltertrayUser>
      <Item name="Id" value="FiltertrayUser" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="FunctionName" value="FinPlusFilterbarTray" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="TimeStamp" value="Unbooked" type="DateTime" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="ChildrenCount" value="2" type="Int32" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="FilteredOut" value="UserId:nortonj,smithk;UserName:jon norton;" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
    </_FiltertrayUser>
    <_FilterbarUserId>
      <Item name="Id" value="FilterbarUserId" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="FunctionName" value="FinPlusFilterbar" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="TimeStamp" value="Unbooked" type="DateTime" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="ChildrenCount" value="3" type="Int32" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="FilteredOut" value="UserId:nortonj,smithk;" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="ItemName" value="UserId" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
    </_FilterbarUserId>
    <_FilterbarUserName>
      <Item name="Id" value="FilterbarUserName" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="FunctionName" value="FinPlusFilterbar" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="TimeStamp" value="Unbooked" type="DateTime" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="ChildrenCount" value="3" type="Int32" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="FilteredOut" value="UserName:jon norton;" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
      <Item name="ItemName" value="UserName" type="String" timestamp="30/11/2013 10:57:14" user="norton" />
    </_FilterbarUserName>

Each component contains a list of TestStates.

    public partial class FinPlusFilterbarTray : FinPlusControl
    {
        public override string Id { get; set; }
        public override string[] States { get { return new string[] { "Height", "Width", "Left", "Top" }; } }
        public override string[] TestStates { get { return new string[] { "ChildrenCount", "FilteredOut" }; } }

Templates** **

Template Type
TestBuilder.view (sourceforge.net) View.

Note this uses other templates in IOC fashion.


Related

Wiki: FinPlusWPFControlsTest
Wiki: Projects
Wiki: SideBar
Wiki: TechnicalDebt