jeudi 31 mai 2018

Testing passing parameter in C# code

Below i've pasted my code. I'm using BDD so have written code for my 'Then' step in my feature file. My code validates data within a file with data i'm expecting it to have. Within my feature file i'm also passing parameters (see below). How can i pass a third validation in my code to make sure the correct lifecyclestatus is being run?

Then measure should be generated <lifecyclestatus>
Examples: 
| Lifecyclestatus |
| New             |
| Current         |







 using System; // Other usings 
using NUnit.Framework;

namespace MyTests
{
....


[TestCase("irm_xxx_tbbmf_xu.csv.ovr", "6677,6677_6677,3001,6")]
[TestCase("irm_xxx_tbbmf_xxx.csv.ovr", "6677,22,344")]
public void ValidateInventoryMeasurement(string path, string expected)
{
    const string processFilePath = "/orabin/product/inputs/actuals/";
    var actual = Common.LinuxCommandExecutor
                       .RunLinuxcommand($"cat {processFilePath}{path}");

    Assert.AreEqual(expected, actual);
}

Aucun commentaire:

Enregistrer un commentaire