Projektdateien hinzufügen.
This commit is contained in:
32
VideoBrowser.Test/Common/ByteFormatProviderTest.cs
Normal file
32
VideoBrowser.Test/Common/ByteFormatProviderTest.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace VideoBrowser.Test.Common
|
||||
{
|
||||
using FluentAssertions;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using VideoBrowser.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the <see cref="ByteFormatProviderTest" />
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public class ByteFormatProviderTest
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// The FileSizeFormatProvider_With_String
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void ByteSizeFormatProvider_With_String()
|
||||
{
|
||||
var provider = new ByteFormatProvider();
|
||||
var size = 1000000.0;
|
||||
var formatedSize = string.Format(new ByteFormatProvider(), "{0:fs}", size);
|
||||
formatedSize.Should().Be("976.56 KB");
|
||||
var speed = 1000000000.0;
|
||||
var formatedSpeed = string.Format(new ByteFormatProvider(), "{0:s}", speed);
|
||||
formatedSpeed.Should().Be("953.67 MB/s");
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
}
|
||||
31
VideoBrowser.Test/Common/ManualTestAttribute.cs
Normal file
31
VideoBrowser.Test/Common/ManualTestAttribute.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace VideoBrowser.Test.Common
|
||||
{
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the <see cref="ManualTestAttribute" />.
|
||||
/// </summary>
|
||||
public class ManualTestAttribute : TestCategoryBaseAttribute
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ManualTestAttribute"/> class.
|
||||
/// </summary>
|
||||
public ManualTestAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets the TestCategories.
|
||||
/// </summary>
|
||||
public override IList<string> TestCategories => new List<string> { "ManualTest" };
|
||||
|
||||
#endregion Properties
|
||||
}
|
||||
}
|
||||
28
VideoBrowser.Test/Common/PercentageTest.cs
Normal file
28
VideoBrowser.Test/Common/PercentageTest.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace VideoBrowser.Test.Common
|
||||
{
|
||||
using FluentAssertions;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using VideoBrowser.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the <see cref="PercentageTest" />
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public class PercentageTest
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// The PercentageTest_Constructor
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void PercentageTest_Constructor()
|
||||
{
|
||||
var percentage = new Percentage(50);
|
||||
percentage.Normalized.Should().Be(0.5);
|
||||
percentage.ToString().Should().Be("50%");
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user