2010-02-09 20:05:54 +00:00
|
|
|
|
// 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;
|
2011-05-15 17:41:14 +00:00
|
|
|
|
using CUETools.CTDB;
|
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
using System.IO;
|
2010-02-09 20:05:54 +00:00
|
|
|
|
|
|
|
|
|
|
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>
|
2010-03-20 07:09:07 +00:00
|
|
|
|
///A test for CD-Extra
|
2010-02-09 20:05:54 +00:00
|
|
|
|
///</summary>
|
|
|
|
|
|
[TestMethod()]
|
2010-03-20 07:09:07 +00:00
|
|
|
|
public void OpenCDExtra()
|
2010-02-09 20:05:54 +00:00
|
|
|
|
{
|
|
|
|
|
|
// test playstation-type CD-Extra
|
2010-03-20 07:09:07 +00:00
|
|
|
|
CUESheet target = new CUESheet(new CUEConfig());
|
2010-02-09 20:05:54 +00:00
|
|
|
|
target.Open("Circuitry\\1.cue");
|
2011-06-03 19:15:28 +00:00
|
|
|
|
Assert.AreEqual<string>("-0:37001:70001:99814:126819:160976", target.TOC.ToString(), "Wrong TOC");
|
2010-02-09 20:05:54 +00:00
|
|
|
|
|
2010-03-03 23:52:46 +00:00
|
|
|
|
// test playstation-type CD-Extra with nonstandard pregap
|
2010-03-20 07:09:07 +00:00
|
|
|
|
target = new CUESheet(new CUEConfig());
|
2010-03-03 23:52:46 +00:00
|
|
|
|
target.Open("Headcandy\\Headcandy.cue");
|
2011-06-03 19:15:28 +00:00
|
|
|
|
Assert.AreEqual<string>("-0:141942:168581:223645:248699:279575:312824", target.TOC.ToString(), "Wrong TOC");
|
2010-03-03 23:52:46 +00:00
|
|
|
|
|
2010-03-20 07:09:07 +00:00
|
|
|
|
// test playstation-type CD-Extra with no info in cuesheet
|
|
|
|
|
|
target = new CUESheet(new CUEConfig());
|
|
|
|
|
|
target.Open("Anatomy\\Anatomy.cue");
|
2011-06-03 19:15:28 +00:00
|
|
|
|
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");
|
|
|
|
|
|
|
2010-03-20 07:09:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///A test for Enhanced-CD
|
|
|
|
|
|
///</summary>
|
|
|
|
|
|
[TestMethod()]
|
|
|
|
|
|
public void OpenEnhancedCD()
|
|
|
|
|
|
{
|
2010-02-09 20:05:54 +00:00
|
|
|
|
// test Enhanced-CD
|
2010-03-20 07:09:07 +00:00
|
|
|
|
CUESheet target = new CUESheet(new CUEConfig());
|
2010-02-09 20:05:54 +00:00
|
|
|
|
target.Open("No Man's Land\\1.cue");
|
|
|
|
|
|
Assert.AreEqual<string>("0015c42c-00d1e13f-ba0fe50d", AccurateRipVerify.CalculateAccurateRipId(target.TOC), "Wrong TOC");
|
2010-03-20 07:09:07 +00:00
|
|
|
|
}
|
2010-02-09 20:05:54 +00:00
|
|
|
|
|
2010-03-20 07:09:07 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
///A test for one-track CD
|
|
|
|
|
|
///</summary>
|
|
|
|
|
|
[TestMethod()]
|
|
|
|
|
|
public void OpenOneTrackCD()
|
|
|
|
|
|
{
|
2010-02-09 20:05:54 +00:00
|
|
|
|
// test one-track CD
|
2010-03-20 07:09:07 +00:00
|
|
|
|
CUESheet target = new CUESheet(new CUEConfig());
|
2010-02-09 20:05:54 +00:00
|
|
|
|
target.Open("Amarok\\Amarok.cue");
|
2010-03-20 07:09:07 +00:00
|
|
|
|
Assert.AreEqual<string>("00041f6d-00083ece-020e1201", AccurateRipVerify.CalculateAccurateRipId(target.TOC), "Wrong TOC");
|
2010-02-09 20:05:54 +00:00
|
|
|
|
}
|
2011-05-15 17:41:14 +00:00
|
|
|
|
|
|
|
|
|
|
[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());
|
|
|
|
|
|
}
|
2010-02-09 20:05:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|