I'm new to this, so really don't know if i'm doing this right. The code I want to test is:
public int[] IntArray(string text)
{
return text.Split(',').Select(x => int.Parse(x.Trim())).ToArray();
}
The test I already have is not complete, so hoping someone can help:
[TestClass]
public class ContextHelperTests
{
public ContextHelper CreateTarget()
{
var context = new ContextHelper()
};
return new ContextHelper();
}
[TestMethod]
public void TestContextHelper()
{
// Arrange
var expectedResult = 12,3;
}
// Act
var values = context.Split(',');
int actualResult = values.Select(x => int.Parse(x)).ToArray();
// Assert
Assert.That(actualResult, Is.EqualTo(expectedResult));
Aucun commentaire:
Enregistrer un commentaire