Skip to content

Instantly share code, notes, and snippets.

@gashupl
Created January 8, 2019 07:48
Show Gist options
  • Save gashupl/484809679155bf8707f9d2559a007d34 to your computer and use it in GitHub Desktop.
Save gashupl/484809679155bf8707f9d2559a007d34 to your computer and use it in GitHub Desktop.
[TestFixture]
public class TestProgram
{
private string expectedText = "Expected text";
private string initialText = "Initial text";
[Test]
public void TestChangeValue()
{
var mySample = new SampleClass(initialText);
Program.ChangeValue(mySample, expectedText);
Assert.AreEqual(expectedText, mySample.Value);
}
[Test]
public void TestChangeValueRef()
{
var mySample = new SampleClass(initialText);
Program.ChangeValue(ref mySample, expectedText);
Assert.AreEqual(expectedText, mySample.Value);
}
[Test]
public void TestInit()
{
var mySample = new SampleClass(initialText);
Program.InitValue(mySample, expectedText);
Assert.AreEqual(expectedText, mySample.Value);
}
[Test]
public void TestInitRef()
{
var mySample = new SampleClass(initialText);
Program.InitValue(ref mySample, expectedText);
Assert.AreEqual(expectedText, mySample.Value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment