58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
|
using NUnit.Framework;
|
|
using LCU.API.Internal.MemberPreferencesApi.Models;
|
|
|
|
namespace LCU.API.Internal.MemberPreferencesApi.UnitTests.XdiBatch
|
|
{
|
|
public class XdiBatchFileTest
|
|
{
|
|
[SetUp]
|
|
public void Setup()
|
|
{
|
|
}
|
|
|
|
[Test]
|
|
public void TestNewEnrollFile()
|
|
{
|
|
var newFile = new XdiBatchFile()
|
|
{
|
|
Type = XdiFileType.AddMemberElectronic,
|
|
Data = new List<XdiBatchFileRow>()
|
|
{
|
|
new XdiBatchFileRow()
|
|
{
|
|
Email = "[email protected]",
|
|
UserId = "99",
|
|
CellPhone = ""
|
|
},
|
|
new XdiBatchFileRow()
|
|
{
|
|
Email = "[email protected]",
|
|
UserId = "89",
|
|
CellPhone = ""
|
|
},
|
|
new XdiBatchFileRow()
|
|
{
|
|
Email = "[email protected]",
|
|
UserId = "79",
|
|
CellPhone = ""
|
|
}
|
|
}
|
|
};
|
|
var fileName = newFile.GetFileName();
|
|
var stringResults = newFile.ConvertToDataRows();
|
|
|
|
var results = newFile.ConvertToDataFile();
|
|
|
|
Assert.NotNull(fileName);
|
|
Assert.AreEqual("Enrollment_AddElectronic_LMCU.txt", fileName);
|
|
|
|
Assert.NotNull(results);
|
|
Assert.NotNull(stringResults);
|
|
Assert.AreEqual("99|[email protected]|", stringResults.First());
|
|
}
|
|
}
|
|
}
|