Tests Architechture.

This commit is contained in:
parallelbgls
2017-01-16 10:30:21 +08:00
parent 6d96dbd036
commit 1e7e30bbcd
5 changed files with 149 additions and 6 deletions

View File

@@ -1,14 +1,50 @@
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
{
[TestClass]
public class BaseTest
public sealed class TestAddresses
{
[TestMethod]
public void TestMethod1()
private Dictionary<string, Tuple<int, int, int>[]> Addresses { get; } = new Dictionary<string, Tuple<int, int, int>[]>();
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;
}
}
}
}
}