Tests Architechture.
This commit is contained in:
13
Tests/Modbus.Net.Tests/AddressMaker.cs
Normal file
13
Tests/Modbus.Net.Tests/AddressMaker.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Modbus.Net.Tests
|
||||||
|
{
|
||||||
|
public class AddressMaker
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
27
Tests/Modbus.Net.Tests/AddressTest.cs
Normal file
27
Tests/Modbus.Net.Tests/AddressTest.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
|
namespace Modbus.Net.Tests
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class AddressTest
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void CombinerTest()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void FormaterTest()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TranslatorTest()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,50 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Modbus.Net.Tests
|
namespace Modbus.Net.Tests
|
||||||
{
|
{
|
||||||
[TestClass]
|
public sealed class TestAddresses
|
||||||
public class BaseTest
|
|
||||||
{
|
{
|
||||||
[TestMethod]
|
private Dictionary<string, Tuple<int, int, int>[]> Addresses { get; } = new Dictionary<string, Tuple<int, int, int>[]>();
|
||||||
public void TestMethod1()
|
|
||||||
|
public Tuple<int, int, int>[] this[string index]
|
||||||
{
|
{
|
||||||
|
get { return Addresses[index]; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (!Addresses.ContainsKey(index))
|
||||||
|
{
|
||||||
|
Addresses.Add(index, value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Addresses[index] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class TestAreas
|
||||||
|
{
|
||||||
|
private Dictionary<string, string[]> Areas { get; } = new Dictionary<string, string[]>();
|
||||||
|
|
||||||
|
public string[] this[string index]
|
||||||
|
{
|
||||||
|
get { return Areas[index]; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (!Areas.ContainsKey(index))
|
||||||
|
{
|
||||||
|
Areas.Add(index, value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Areas[index] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
62
Tests/Modbus.Net.Tests/CommunicationTest.cs
Normal file
62
Tests/Modbus.Net.Tests/CommunicationTest.cs
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
|
namespace Modbus.Net.Tests
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class CommunicationTest
|
||||||
|
{
|
||||||
|
public void CommunicationInvoke(string addressFullName, int count)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void CoilSingleRead()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void CoilMuiltiRead()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void CoilSingleWrite()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void CoilMuiltiWrite()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RegisterSingleRead()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RegistertMultiRead()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RegisterSingleWrite()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void RegistertMultiWrite()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,13 +45,18 @@
|
|||||||
</When>
|
</When>
|
||||||
<Otherwise>
|
<Otherwise>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Otherwise>
|
</Otherwise>
|
||||||
</Choose>
|
</Choose>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="AddressMaker.cs" />
|
||||||
|
<Compile Include="AddressTest.cs" />
|
||||||
<Compile Include="BaseTest.cs" />
|
<Compile Include="BaseTest.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="CommunicationTest.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Choose>
|
<Choose>
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||||
|
|||||||
Reference in New Issue
Block a user