|
1 |
| -using Renci.SshNet.Common; |
2 |
| -using Microsoft.VisualStudio.TestTools.UnitTesting; |
3 |
| -using System; |
4 |
| -using Renci.SshNet.Tests.Common; |
| 1 | +using Microsoft.VisualStudio.TestTools.UnitTesting; |
| 2 | +using Renci.SshNet.Common; |
5 | 3 |
|
6 | 4 | namespace Renci.SshNet.Tests.Classes.Common
|
7 | 5 | {
|
8 |
| - /// <summary> |
9 |
| - ///This is a test class for SshDataTest and is intended |
10 |
| - ///to contain all SshDataTest Unit Tests |
11 |
| - ///</summary> |
12 |
| - [TestClass()] |
13 |
| - [Ignore] // placeholder for actual test |
14 |
| - public class SshDataTest : TestBase |
| 6 | + [TestClass] |
| 7 | + public class SshDataTest |
15 | 8 | {
|
16 |
| - internal virtual SshData CreateSshData() |
| 9 | + [TestMethod] |
| 10 | + public void Write_Boolean_False() |
17 | 11 | {
|
18 |
| - // TODO: Instantiate an appropriate concrete class. |
19 |
| - SshData target = null; |
20 |
| - return target; |
21 |
| - } |
| 12 | + var sshData = new MySshData(); |
| 13 | + sshData.Load(new byte[0]); |
22 | 14 |
|
23 |
| - /// <summary> |
24 |
| - ///A test for GetBytes |
25 |
| - ///</summary> |
26 |
| - [TestMethod()] |
27 |
| - public void GetBytesTest() |
28 |
| - { |
29 |
| - SshData target = CreateSshData(); // TODO: Initialize to an appropriate value |
30 |
| - byte[] expected = null; // TODO: Initialize to an appropriate value |
31 |
| - byte[] actual; |
32 |
| - actual = target.GetBytes(); |
33 |
| - Assert.AreEqual(expected, actual); |
34 |
| - Assert.Inconclusive("Verify the correctness of this test method."); |
| 15 | + sshData.Write(false); |
| 16 | + Assert.AreEqual((byte) 0, sshData.ReadByte()); |
| 17 | + Assert.IsTrue(sshData.IsEndOfData); |
35 | 18 | }
|
36 | 19 |
|
37 |
| - /// <summary> |
38 |
| - ///A test for Load |
39 |
| - ///</summary> |
40 |
| - [TestMethod()] |
41 |
| - public void LoadTest() |
| 20 | + [TestMethod] |
| 21 | + public void Write_Boolean_True() |
42 | 22 | {
|
43 |
| - SshData target = CreateSshData(); // TODO: Initialize to an appropriate value |
44 |
| - byte[] value = null; // TODO: Initialize to an appropriate value |
45 |
| - target.Load(value); |
46 |
| - Assert.Inconclusive("A method that does not return a value cannot be verified."); |
| 23 | + var sshData = new MySshData(); |
| 24 | + sshData.Load(new byte[0]); |
| 25 | + |
| 26 | + sshData.Write(true); |
| 27 | + Assert.AreEqual((byte) 1, sshData.ReadByte()); |
| 28 | + Assert.IsTrue(sshData.IsEndOfData); |
47 | 29 | }
|
48 | 30 |
|
49 |
| - /// <summary> |
50 |
| - ///A test for IsEndOfData |
51 |
| - ///</summary> |
52 |
| - [TestMethod()] |
53 |
| - public void IsEndOfDataTest() |
| 31 | + private class MySshData : SshData |
54 | 32 | {
|
55 |
| - SshData target = CreateSshData(); // TODO: Initialize to an appropriate value |
56 |
| - bool actual; |
57 |
| - actual = target.IsEndOfData; |
58 |
| - Assert.Inconclusive("Verify the correctness of this test method."); |
| 33 | + public new void Write(bool data) |
| 34 | + { |
| 35 | + base.Write(data); |
| 36 | + } |
| 37 | + |
| 38 | + public new byte ReadByte() |
| 39 | + { |
| 40 | + return base.ReadByte(); |
| 41 | + } |
| 42 | + |
| 43 | + protected override void LoadData() |
| 44 | + { |
| 45 | + } |
| 46 | + |
| 47 | + protected override void SaveData() |
| 48 | + { |
| 49 | + } |
59 | 50 | }
|
60 | 51 | }
|
61 | 52 | }
|
0 commit comments