-
Notifications
You must be signed in to change notification settings - Fork 1
/
LibraryPropertyReaderTests.cs
43 lines (37 loc) · 1.87 KB
/
LibraryPropertyReaderTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
namespace TwincatLibraryTests
{
[TestClass]
public class LibraryPropertyReaderTests
{
[TestMethod]
[DeploymentItem(@"ExampleLibraries\TxMatrix.library")]
public void TcMatrixTest()
{
var libraryInfo = TwincatLibraryUtilities.LibraryPropertyReader.getLibraryInfo(@"ExampleLibraries\TcMatrix.library");
Assert.AreEqual("TcMatrix", libraryInfo.Name);
Assert.AreEqual("Matrix arithmatic library", libraryInfo.Description);
Assert.AreEqual("Andrew Burks", libraryInfo.Author);
Assert.AreEqual("Burks Engineering", libraryInfo.Company);
Assert.AreEqual("1.4.3", libraryInfo.Version);
Assert.AreEqual(4,libraryInfo.Dependencies.Count);
}
[TestMethod]
[DeploymentItem(@"ExampleLibraries\TxTransform.library")]
public void TcTransformTest()
{
var libraryInfo = TwincatLibraryUtilities.LibraryPropertyReader.getLibraryInfo(@"ExampleLibraries\TcTransform.library");
Assert.AreEqual("TcTransform", libraryInfo.Name);
Assert.AreEqual("Coordinate system transformation library", libraryInfo.Description);
Assert.AreEqual("Andrew Burks", libraryInfo.Author);
Assert.AreEqual("Burks Engineering", libraryInfo.Company);
Assert.AreEqual("0.3.36", libraryInfo.Version);
var tcMatrixDependency = libraryInfo.Dependencies.FirstOrDefault(d => string.Equals("TcMatrix", d.Name, System.StringComparison.OrdinalIgnoreCase));
Assert.IsNotNull(tcMatrixDependency);
Assert.AreEqual("1.4.3", tcMatrixDependency.Version);
Assert.AreEqual("Burks Engineering", tcMatrixDependency.Company);
Assert.AreEqual("TcMatrix", tcMatrixDependency.Namespace);
}
}
}