Removed old test proj
This commit is contained in:
Родитель
71fe4c0a20
Коммит
18e8ee8a87
|
@ -1,36 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="imports\finserv.csv" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="imports\finserv.csv">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||
<PackageReference Include="coverlet.collector" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BlazingCoffee\Server\BlazingCoffee.Server.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="imports\finserv.csv">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -1,43 +0,0 @@
|
|||
using BlazingCoffee.Server.IO;
|
||||
using BlazingCoffee.Shared.Models;
|
||||
using CsvHelper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
using Telerik.Windows.Documents.Spreadsheet.Expressions.Functions;
|
||||
using Xunit;
|
||||
|
||||
namespace CsvImportTest
|
||||
{
|
||||
public class TestCsvImport
|
||||
{
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
using var reader = new StreamReader(@"./imports/finserv.csv");
|
||||
using var csv = new CsvReader(reader, CultureInfo.InvariantCulture);
|
||||
var records = csv.GetRecords<SalesImportDTO>();
|
||||
IEnumerable<Sale> import = records.Select(dto => new Sale
|
||||
{
|
||||
Amount = dto.Amount,
|
||||
Code = dto.Code,
|
||||
Country = dto.Country,
|
||||
CustomerInfo = dto.CustomerInfo,
|
||||
PromotionId = dto.PromotionId,
|
||||
PaymentType = dto.PaymentType,
|
||||
Sku = dto.Product,
|
||||
ProductGroup = dto.ProductGroup,
|
||||
Region = dto.Region,
|
||||
StoreId = dto.StoreId,
|
||||
TransactionId = dto.TransactionId,
|
||||
TransactionDate = DateTime.Parse($"{dto.TransactionDate} {dto.TransactionHour}")
|
||||
});
|
||||
|
||||
Assert.NotEmpty(import);
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче