I have the following FitNesse test implemented against .NET. It uses "RowFixture" to return an object which is verified. All this works ok.
My Question is, how can I pass the "inputs" to the array from the FIT test? At the monent, this is hard coded internally.
Here is the FIT test:
!|ReturnObjectMultiDimension|
|Id |Name |
|1, 2, 3, 4 |a, b, c, d |
Here is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using fit;
using dbfit;
namespace DbFitProject
{
public class ReturnObjectMultiDimension : RowFixture
{
public override Type GetTargetClass()
{
return typeof(CustomerObject);
}
public override object[] Query()
{
CustomerObject[] array = new CustomerObject[1];
array[0] = new CustomerObject(new int[4] { 1, 2, 3, 4 }, new string[4] {"a","b","c","d" });
return array;
}
}
public class CustomerObject
{
public int[] Id;
public string[] Name;
public CustomerObject(int[] Id, string[] Name)
{
this.Id = Id;
this.Name = Name;
}
}
}
Thanks for help.
It's simpler to just have a class that creates a customer object list and fitSharp will automatically wrap the list in a fixture to check the results:
See http://fitsharp.github.io/Fit/FixtureWrapper.html