2022-08-30 15:42:25 +02:00
|
|
|
|
using System;
|
|
|
|
|
using NUnit.Framework;
|
2021-07-12 21:31:46 +02:00
|
|
|
|
using TINK.Settings;
|
|
|
|
|
|
|
|
|
|
namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
|
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TestPollingParameters
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestConstruct()
|
|
|
|
|
{
|
|
|
|
|
Assert.IsTrue(new PollingParameters(new TimeSpan(0, 0, 11), true).IsActivated);
|
|
|
|
|
Assert.AreEqual(11, (new PollingParameters(new TimeSpan(0, 0, 11), true).Periode.TotalSeconds));
|
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
[Test]
|
|
|
|
|
public void TestEquals()
|
|
|
|
|
{
|
|
|
|
|
Assert.IsTrue((new PollingParameters(new TimeSpan(0, 0, 11), true)) == (new PollingParameters(new TimeSpan(0, 0, 11), true)));
|
|
|
|
|
Assert.IsFalse((new PollingParameters(new TimeSpan(0, 0, 11), false)) == (new PollingParameters(new TimeSpan(0, 0, 11), true)));
|
|
|
|
|
Assert.IsFalse((new PollingParameters(new TimeSpan(0, 0, 12), true)) == (new PollingParameters(new TimeSpan(0, 0, 11), true)));
|
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
[Test]
|
|
|
|
|
public void TestUnequals()
|
|
|
|
|
{
|
|
|
|
|
Assert.IsFalse((new PollingParameters(new TimeSpan(0, 0, 11), true)) != (new PollingParameters(new TimeSpan(0, 0, 11), true)));
|
|
|
|
|
Assert.IsTrue((new PollingParameters(new TimeSpan(0, 0, 11), false)) != (new PollingParameters(new TimeSpan(0, 0, 11), true)));
|
|
|
|
|
Assert.IsTrue((new PollingParameters(new TimeSpan(0, 0, 12), true)) != (new PollingParameters(new TimeSpan(0, 0, 11), true)));
|
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
[Test]
|
|
|
|
|
public void TestToString()
|
|
|
|
|
{
|
|
|
|
|
Assert.AreEqual(
|
|
|
|
|
"Polling is on=True, polling interval=11[sec].",
|
|
|
|
|
(new PollingParameters(new TimeSpan(0, 0, 11), true).ToString()));
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-12 21:31:46 +02:00
|
|
|
|
}
|