Created
January 8, 2019 07:48
-
-
Save gashupl/484809679155bf8707f9d2559a007d34 to your computer and use it in GitHub Desktop.
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
| [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