Created
October 1, 2012 08:49
-
-
Save ritalin/3810393 to your computer and use it in GitHub Desktop.
TestCase passing byte Arrays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using NUnit.Framework; | |
namespace ClassLibrary2 | |
{ | |
[TestFixture] | |
public class Class1 | |
{ | |
[TestCase((byte)1, (byte)2, (byte)3, (byte)4)] | |
public void TestCase1(params byte[] arr) { | |
Assert.That(arr[0], Is.EqualTo(1)); | |
} | |
[TestCase(new byte[] { 0x00, 0x01, 0x02, 0x03 })] | |
public void sample(byte[] input) { | |
Assert.That(input, Is.EqualTo(new byte[] { 0x00, 0x01, 0x02, 0x03 })); | |
} | |
[TestCase(new byte[] { 0x00, 0x00, 0x00, 0x01 }, 100, 200)] | |
public void sample2(byte[] input, int n1, int n2) { | |
Assert.That(input, Is.EqualTo(new byte[] { 0x00, 0x00, 0x00, 0x01 })); | |
Assert.That(n1, Is.EqualTo(100)); | |
Assert.That(n2, Is.EqualTo(200)); | |
} | |
[TestCase(new byte[] { 0x00, 0x00, 0x00, 0x01 }, new byte[] { 0x02, 0x04, 0x06, 0x08 })] | |
public void sample3(byte[] input1, byte[] input2) { | |
Assert.That(input1, Is.EqualTo(new byte[] { 0x00, 0x00, 0x00, 0x01 })); | |
Assert.That(input2, Is.EqualTo(new byte[] { 0x02, 0x04, 0x06, 0x08 })); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment