Files
cuetools.net/CUETools/CUETools.TestProcessor/ProcessorTest.cs
chudov 020610a2ea Support for wierd CDs with two data tracks before audio.
Minor enhancements to CTDB download routine, fixed support for parity files without header
2011-06-03 19:15:28 +00:00

145 lines
4.3 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 CUETools.Processor;
using CUETools.AccurateRip;
using CUETools.CTDB;
using System.Xml.Serialization;
using System.IO;
namespace CUETools.TestProcessor
{
/// <summary>
///This is a test class for CUETools.Processor.CUESheet and is intended
///to contain all CUETools.Processor.CUESheet Unit Tests
///</summary>
[TestClass()]
public class CUESheetTest
{
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 CD-Extra
///</summary>
[TestMethod()]
public void OpenCDExtra()
{
// test playstation-type CD-Extra
CUESheet target = new CUESheet(new CUEConfig());
target.Open("Circuitry\\1.cue");
Assert.AreEqual<string>("-0:37001:70001:99814:126819:160976", target.TOC.ToString(), "Wrong TOC");
// test playstation-type CD-Extra with nonstandard pregap
target = new CUESheet(new CUEConfig());
target.Open("Headcandy\\Headcandy.cue");
Assert.AreEqual<string>("-0:141942:168581:223645:248699:279575:312824", target.TOC.ToString(), "Wrong TOC");
// test playstation-type CD-Extra with no info in cuesheet
target = new CUESheet(new CUEConfig());
target.Open("Anatomy\\Anatomy.cue");
Assert.AreEqual<string>("-0:19687:33144:50680:69872:89822:108084:132098:150625:166271:194882:200172:215884:236046:242815:269518:282018:293416", target.TOC.ToString(), "Wrong TOC");
// test playstation-type CD-Extra with two data tracks
target = new CUESheet(new CUEConfig());
target.Open("Les Mysterieuses Cites d'Or\\Les Mysterieuses Cites d'Or.cue");
Assert.AreEqual<string>("-0:-31952:127883:137816:149173:160223:171479:180777:186738:196134:205613:214526:221674:227031:232824:239376:249495:259604:266115:267080:275100:281599:284452:291422:295511:297642:302114:309263:312269:320051:326235:333841", target.TOC.ToString(), "Wrong TOC");
}
/// <summary>
///A test for Enhanced-CD
///</summary>
[TestMethod()]
public void OpenEnhancedCD()
{
// test Enhanced-CD
CUESheet target = new CUESheet(new CUEConfig());
target.Open("No Man's Land\\1.cue");
Assert.AreEqual<string>("0015c42c-00d1e13f-ba0fe50d", AccurateRipVerify.CalculateAccurateRipId(target.TOC), "Wrong TOC");
}
/// <summary>
///A test for one-track CD
///</summary>
[TestMethod()]
public void OpenOneTrackCD()
{
// test one-track CD
CUESheet target = new CUESheet(new CUEConfig());
target.Open("Amarok\\Amarok.cue");
Assert.AreEqual<string>("00041f6d-00083ece-020e1201", AccurateRipVerify.CalculateAccurateRipId(target.TOC), "Wrong TOC");
}
[TestMethod()]
[Ignore]
public void CTDBResponseTest()
{
XmlSerializer serializer = new XmlSerializer(typeof(CTDBResponse));
string respXml = File.ReadAllText("Z:\\ctdb.xml");
CTDBResponse resp;
using (TextReader reader = new StringReader(respXml))
resp = serializer.Deserialize(reader) as CTDBResponse;
var writer = new StringWriter();
serializer.Serialize(writer, resp);
Assert.AreEqual(respXml, writer.ToString());
}
}
}