Skip to content

Commit fff035b

Browse files
authored
Merge pull request #1 from yoyokits/development
Release Alpha 0.1
2 parents 457adee + 8c317db commit fff035b

File tree

95 files changed

+9371
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+9371
-0
lines changed

docs/examples/CountryTest.csv

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Name,Indonesia,America,Germany,Singapore
2+
18/7/2020,0,15,10,5
3+
19/7/2020,10,25,20,10
4+
20/7/2020,35,30,30,15
5+
21/7/2020,40,45,40,30
6+
22/7/2020,60,50,55,45
7+
23/7/2020,80,50,55,45
363 KB
Loading

docs/images/CsvSourceExample.jpg

29.1 KB
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
8+
<Platforms>AnyCPU;x64</Platforms>
9+
10+
<SignAssembly>true</SignAssembly>
11+
12+
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
13+
14+
<Version>0.1.0</Version>
15+
</PropertyGroup>
16+
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
18+
<PlatformTarget>x64</PlatformTarget>
19+
</PropertyGroup>
20+
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
22+
<PlatformTarget>x64</PlatformTarget>
23+
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<None Remove="TestData\CountryTest.csv" />
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<EmbeddedResource Include="TestData\CountryTest.csv">
31+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
32+
</EmbeddedResource>
33+
</ItemGroup>
34+
35+
<ItemGroup>
36+
<PackageReference Include="FluentAssertions" Version="5.10.3" />
37+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
38+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
39+
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
40+
<PackageReference Include="coverlet.collector" Version="1.2.0" />
41+
</ItemGroup>
42+
43+
<ItemGroup>
44+
<ProjectReference Include="..\BarChartRaceNet\BarChartRaceNet.csproj" />
45+
</ItemGroup>
46+
47+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace BarChartRaceNet.Test.Common
2+
{
3+
using BarChartRaceNet.Common;
4+
using FluentAssertions;
5+
using Microsoft.VisualStudio.TestTools.UnitTesting;
6+
7+
/// <summary>
8+
/// Defines the <see cref="RangeDoubleTest" />.
9+
/// </summary>
10+
[TestClass]
11+
public class RangeDoubleTest
12+
{
13+
#region Methods
14+
15+
/// <summary>
16+
/// The Range.
17+
/// </summary>
18+
[TestMethod]
19+
public void Range()
20+
{
21+
var range = RangeDouble.Range(0, 1);
22+
range.Length.Should().Be(2);
23+
range[0].Should().Be(0);
24+
range[1].Should().Be(1);
25+
26+
range = RangeDouble.Range(-1, 2);
27+
range.Length.Should().Be(4);
28+
range[0].Should().Be(-1);
29+
range[1].Should().Be(0);
30+
range[2].Should().Be(1);
31+
range[3].Should().Be(2);
32+
}
33+
34+
#endregion Methods
35+
}
36+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
namespace BarChartRaceNet.Test.Helpers
2+
{
3+
using BarChartRaceNet.Helpers;
4+
using BarChartRaceNet.Test.TestHelpers;
5+
using FluentAssertions;
6+
using Microsoft.VisualStudio.TestTools.UnitTesting;
7+
using System.Linq;
8+
9+
/// <summary>
10+
/// Defines the <see cref="BarAnimationHelperTest" />.
11+
/// </summary>
12+
[TestClass]
13+
public class BarAnimationHelperTest
14+
{
15+
#region Methods
16+
17+
/// <summary>
18+
/// The Test.
19+
/// </summary>
20+
[TestMethod]
21+
public void DatasetToBarValuesModels()
22+
{
23+
var array2D = CsvFileHelper.Load(TestData.CountryTestCsv);
24+
var models = array2D.DatasetToBarValuesModels();
25+
models.Should().NotBeNull();
26+
models.Count.Should().Be(4);
27+
foreach (var model in models)
28+
{
29+
model.Ranks.Length.Should().Be(6);
30+
model.Values.Length.Should().Be(6);
31+
}
32+
}
33+
34+
/// <summary>
35+
/// The DatasetToDoubleArray.
36+
/// </summary>
37+
[TestMethod]
38+
public void DatasetToDoubleArray()
39+
{
40+
var array2D = CsvFileHelper.Load(TestData.CountryTestCsv);
41+
var doubleArray2D = array2D.DatasetToDoubleArray();
42+
doubleArray2D.Should().NotBeNull();
43+
doubleArray2D.Length.Should().Be(6);
44+
doubleArray2D.First().Length.Should().Be(4);
45+
}
46+
47+
#endregion Methods
48+
}
49+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
namespace BarChartRaceNet.Test.Helpers
2+
{
3+
using BarChartRaceNet.Helpers;
4+
using BarChartRaceNet.Test.TestHelpers;
5+
using FluentAssertions;
6+
using Microsoft.VisualStudio.TestTools.UnitTesting;
7+
using System.Linq;
8+
9+
/// <summary>
10+
/// Defines the <see cref="CsvFileHelperTest" />.
11+
/// </summary>
12+
[TestClass]
13+
public class CsvFileHelperTest
14+
{
15+
#region Methods
16+
17+
/// <summary>
18+
/// The Load.
19+
/// </summary>
20+
[TestMethod]
21+
public void Load()
22+
{
23+
var records = CsvFileHelper.Load(TestData.CountryTestCsv);
24+
records.Should().NotBeNull();
25+
records.Length.Should().Be(7);
26+
records.First().Length.Should().Be(5);
27+
}
28+
29+
#endregion Methods
30+
}
31+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Name,In/donesia,Ameri ca,Germany,Singa.pore
2+
18/7/2020,0,15,10,5
3+
19/7/2020,10,25,20,10
4+
20/7/2020,35,30,30,15
5+
21/7/2020,40,45,40,30
6+
22/7/2020,60,50,55,45
7+
23/7/2020,80,50,55,45
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
namespace BarChartRaceNet.Test.TestHelpers
2+
{
3+
using Microsoft.VisualStudio.TestTools.UnitTesting;
4+
using System.Collections.Generic;
5+
6+
/// <summary>
7+
/// Defines the <see cref="ManualTestAttribute" />.
8+
/// </summary>
9+
public class ManualTestAttribute : TestCategoryBaseAttribute
10+
{
11+
#region Constructors
12+
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="ManualTestAttribute"/> class.
15+
/// </summary>
16+
public ManualTestAttribute()
17+
{
18+
}
19+
20+
#endregion Constructors
21+
22+
#region Properties
23+
24+
/// <summary>
25+
/// Gets the TestCategories.
26+
/// </summary>
27+
public override IList<string> TestCategories => new List<string> { "ManualTest" };
28+
29+
#endregion Properties
30+
}
31+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace BarChartRaceNet.Test.TestHelpers
2+
{
3+
using System.IO;
4+
5+
/// <summary>
6+
/// Defines the <see cref="TestData" />.
7+
/// </summary>
8+
public static class TestData
9+
{
10+
#region Constructors
11+
12+
/// <summary>
13+
/// Initializes static members of the <see cref="TestData"/> class.
14+
/// </summary>
15+
static TestData()
16+
{
17+
CountryTestCsv = Path.Combine(TestDataFolder, "CountryTest.csv");
18+
}
19+
20+
#endregion Constructors
21+
22+
#region Properties
23+
24+
/// <summary>
25+
/// Gets the CountryTestCsv.
26+
/// </summary>
27+
public static string CountryTestCsv { get; }
28+
29+
/// <summary>
30+
/// Gets the TestDataFolder.
31+
/// </summary>
32+
public static string TestDataFolder { get; } = "TestData";
33+
34+
#endregion Properties
35+
}
36+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
namespace BarChartRaceNet.Test.Tools
2+
{
3+
using BarChartRaceNet.Core;
4+
using BarChartRaceNet.Tools;
5+
using FluentAssertions;
6+
using Microsoft.VisualStudio.TestTools.UnitTesting;
7+
using System.Collections.Generic;
8+
9+
/// <summary>
10+
/// Defines the <see cref="StatisticsTest" />.
11+
/// </summary>
12+
[TestClass]
13+
public class StatisticsTest
14+
{
15+
#region Methods
16+
17+
/// <summary>
18+
/// The se.
19+
/// </summary>
20+
[TestMethod]
21+
public void Calculate()
22+
{
23+
var list = new List<double> { 1, 2, 3 };
24+
var output = list.Calculate(StatisticsMethod.Average, 1);
25+
output.Should().Be("Average: 2.0");
26+
output = list.Calculate(StatisticsMethod.PercentageAverage, 2);
27+
output.Should().Be("Average: 2.00%");
28+
output = list.Calculate(StatisticsMethod.Total, 2);
29+
output.Should().Be("Total: 6.00");
30+
}
31+
32+
#endregion Methods
33+
}
34+
}

src/BarChartRaceNet.Test/key.snk

596 Bytes
Binary file not shown.

src/BarChartRaceNet.sln

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30225.117
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BarChartRaceNet", "BarChartRaceNet\BarChartRaceNet.csproj", "{664E0A49-BE85-4963-9102-4BD9F6D35C54}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BarChartRaceNet.Test", "BarChartRaceNet.Test\BarChartRaceNet.Test.csproj", "{DBC6FBCD-F81A-4B30-BE18-D09311535C08}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BarChartRaceNetTestApp", "BarChartRaceNetTestApp\BarChartRaceNetTestApp.csproj", "{D0C56C62-95DD-4843-AED8-31411FA4CA8F}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Debug|x64 = Debug|x64
16+
Release|Any CPU = Release|Any CPU
17+
Release|x64 = Release|x64
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{664E0A49-BE85-4963-9102-4BD9F6D35C54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{664E0A49-BE85-4963-9102-4BD9F6D35C54}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{664E0A49-BE85-4963-9102-4BD9F6D35C54}.Debug|x64.ActiveCfg = Debug|x64
23+
{664E0A49-BE85-4963-9102-4BD9F6D35C54}.Debug|x64.Build.0 = Debug|x64
24+
{664E0A49-BE85-4963-9102-4BD9F6D35C54}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{664E0A49-BE85-4963-9102-4BD9F6D35C54}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{664E0A49-BE85-4963-9102-4BD9F6D35C54}.Release|x64.ActiveCfg = Release|x64
27+
{664E0A49-BE85-4963-9102-4BD9F6D35C54}.Release|x64.Build.0 = Release|x64
28+
{DBC6FBCD-F81A-4B30-BE18-D09311535C08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{DBC6FBCD-F81A-4B30-BE18-D09311535C08}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{DBC6FBCD-F81A-4B30-BE18-D09311535C08}.Debug|x64.ActiveCfg = Debug|x64
31+
{DBC6FBCD-F81A-4B30-BE18-D09311535C08}.Debug|x64.Build.0 = Debug|x64
32+
{DBC6FBCD-F81A-4B30-BE18-D09311535C08}.Release|Any CPU.ActiveCfg = Release|Any CPU
33+
{DBC6FBCD-F81A-4B30-BE18-D09311535C08}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{DBC6FBCD-F81A-4B30-BE18-D09311535C08}.Release|x64.ActiveCfg = Release|x64
35+
{DBC6FBCD-F81A-4B30-BE18-D09311535C08}.Release|x64.Build.0 = Release|x64
36+
{D0C56C62-95DD-4843-AED8-31411FA4CA8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{D0C56C62-95DD-4843-AED8-31411FA4CA8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{D0C56C62-95DD-4843-AED8-31411FA4CA8F}.Debug|x64.ActiveCfg = Debug|x64
39+
{D0C56C62-95DD-4843-AED8-31411FA4CA8F}.Debug|x64.Build.0 = Debug|x64
40+
{D0C56C62-95DD-4843-AED8-31411FA4CA8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{D0C56C62-95DD-4843-AED8-31411FA4CA8F}.Release|Any CPU.Build.0 = Release|Any CPU
42+
{D0C56C62-95DD-4843-AED8-31411FA4CA8F}.Release|x64.ActiveCfg = Release|x64
43+
{D0C56C62-95DD-4843-AED8-31411FA4CA8F}.Release|x64.Build.0 = Release|x64
44+
EndGlobalSection
45+
GlobalSection(SolutionProperties) = preSolution
46+
HideSolutionNode = FALSE
47+
EndGlobalSection
48+
GlobalSection(ExtensibilityGlobals) = postSolution
49+
SolutionGuid = {53B236DF-1CAA-4334-A770-D98A142743E0}
50+
EndGlobalSection
51+
EndGlobal

src/BarChartRaceNet/App.xaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Application
2+
x:Class="BarChartRaceNet.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
StartupUri="Views/MainWindow.xaml">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
10+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
11+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
12+
</ResourceDictionary.MergedDictionaries>
13+
</ResourceDictionary>
14+
</Application.Resources>
15+
</Application>

src/BarChartRaceNet/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace BarChartRaceNet
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

0 commit comments

Comments
 (0)