mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 18:46:30 +01:00
41 lines
1.5 KiB
C#
41 lines
1.5 KiB
C#
|
using System;
|
||
|
using NUnit.Framework;
|
||
|
using ShareeBike.Settings;
|
||
|
|
||
|
namespace SharedBusinessLogic.Tests.Fixtures.ObjectTests.SettingsNS
|
||
|
{
|
||
|
[TestFixture]
|
||
|
public class TestPollingParameters
|
||
|
{
|
||
|
[Test]
|
||
|
public void TestConstruct()
|
||
|
{
|
||
|
Assert.That(new PollingParameters(new TimeSpan(0, 0, 11), true).IsActivated, Is.True);
|
||
|
Assert.That((new PollingParameters(new TimeSpan(0, 0, 11), true).Periode.TotalSeconds), Is.EqualTo(11));
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void TestEquals()
|
||
|
{
|
||
|
Assert.That((new PollingParameters(new TimeSpan(0, 0, 11), true)) == (new PollingParameters(new TimeSpan(0, 0, 11), true)), Is.True);
|
||
|
Assert.That((new PollingParameters(new TimeSpan(0, 0, 11), false)) == (new PollingParameters(new TimeSpan(0, 0, 11), true)), Is.False);
|
||
|
Assert.That((new PollingParameters(new TimeSpan(0, 0, 12), true)) == (new PollingParameters(new TimeSpan(0, 0, 11), true)), Is.False);
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void TestUnequals()
|
||
|
{
|
||
|
Assert.That((new PollingParameters(new TimeSpan(0, 0, 11), true)) != (new PollingParameters(new TimeSpan(0, 0, 11), true)), Is.False);
|
||
|
Assert.That((new PollingParameters(new TimeSpan(0, 0, 11), false)) != (new PollingParameters(new TimeSpan(0, 0, 11), true)), Is.True);
|
||
|
Assert.That((new PollingParameters(new TimeSpan(0, 0, 12), true)) != (new PollingParameters(new TimeSpan(0, 0, 11), true)), Is.True);
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void TestToString()
|
||
|
{
|
||
|
Assert.That(
|
||
|
(new PollingParameters(new TimeSpan(0, 0, 11), true).ToString()), Is.EqualTo("Polling is on=True, polling interval=11[sec]."));
|
||
|
}
|
||
|
}
|
||
|
}
|