Files
cuetools.net/CUETools/CUETools.TestCodecs/FlakeWriterTest.cs
2010-02-06 23:17:07 +00:00

106 lines
2.8 KiB
C#

// The following code was generated by Microsoft Visual Studio 2005.
// The test owner should check each test for validity.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Collections.Generic;
using System.IO;
using CUETools.Codecs;
using CUETools.Codecs.FLAKE;
namespace CUETools.TestCodecs
{
/// <summary>
///This is a test class for CUETools.Codecs.FLAKE.FlakeWriter and is intended
///to contain all CUETools.Codecs.FLAKE.FlakeWriter Unit Tests
///</summary>
[TestClass()]
public class FlakeWriterTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
//You can use the following additional attributes as you write your tests:
//
//Use ClassInitialize to run code before running the first test in the class
//
//[ClassInitialize()]
//public static void MyClassInitialize(TestContext testContext)
//{
//}
//
//Use ClassCleanup to run code after all tests in a class have run
//
//[ClassCleanup()]
//public static void MyClassCleanup()
//{
//}
//
//Use TestInitialize to run code before running each test
//
//[TestInitialize()]
//public void MyTestInitialize()
//{
//}
//
//Use TestCleanup to run code after each test has run
//
//[TestCleanup()]
//public void MyTestCleanup()
//{
//}
//
#endregion
/// <summary>
///A test for FlakeWriter (string, int, int, int, Stream)
///</summary>
[TestMethod()]
public void ConstructorTest()
{
AudioBuffer buff = WAVReader.ReadAllSamples("test.wav", null);
FlakeWriter target;
target = new FlakeWriter("flakewriter0.flac", null, buff.PCM);
target.PaddingLength = 1;
target.DoSeekTable = false;
//target.Vendor = "CUETools";
//target.CreationTime = DateTime.Parse("15 Aug 1976");
target.FinalSampleCount = buff.Length;
target.Write(buff);
target.Close();
CollectionAssert.AreEqual(File.ReadAllBytes("flake.flac"), File.ReadAllBytes("flakewriter0.flac"), "flakewriter0.flac doesn't match.");
target = new FlakeWriter("flakewriter1.flac", null, buff.PCM);
target.PaddingLength = 1;
target.DoSeekTable = false;
//target.Vendor = "CUETools";
//target.CreationTime = DateTime.Parse("15 Aug 1976");
target.Write(buff);
target.Close();
CollectionAssert.AreEqual(File.ReadAllBytes("flake.flac"), File.ReadAllBytes("flakewriter1.flac"), "flakewriter1.flac doesn't match.");
}
}
}