Files
DP44/DataPRO/UnitTest/DTS.Common.Import.Tests/GroupHelperShould.cs
2026-04-17 14:55:32 -04:00

51 lines
1.5 KiB
C#

using DataPROWin7.DataModel;
using DTS.Common.Interface.TestSetups.TestSetupsList;
using DTS.SensorDB;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTS.Common.Import.Tests
{
class GroupHelperShould
{
[Test]
public void CreateEmptyGroup_ShouldCreateNewGroup()
{
var res = GroupHelper.CreateEmptyGroup();
Assert.That(res.LastModifiedBy, Is.EqualTo("---"));
}
[Test]
public void ReverseChannelOrder_ShouldNotThorwExceptionOnNullTestTemplate()
{
var dict = new Dictionary<string, string>();
dict.Add("1", "a");
var sens = NSubstitute.Substitute.For<SensorData>();
var res = GroupHelper.ReverseChannelOrder(null, dict, new List<SensorDB.SensorData> { sens });
Assert.That(res.Count, Is.EqualTo(0));
}
[Test]
public void ReverseChannelOrder_ShouldNotThorwExceptionOnNullSensors()
{
var dict = new Dictionary<string, string>();
dict.Add("1", "a");
var res = GroupHelper.ReverseChannelOrder(null, dict,null);
Assert.That(res.Count, Is.EqualTo(0));
}
[Test]
public void NormalizeSensorIds_ShouldNotThorwExceptionOnNullSensors()
{
var res = GroupHelper.NormalizeSensorIds(null);
Assert.That(res.Count, Is.EqualTo(0));
}
}
}