示例#1
0
        public void WhenYearIsSet_ReturnYear()
        {
            byte[] data   = new byte[] { 0x49, 0x44, 0x33, 0, 0, 0, 0, 0, 0, 0x21, 0x54, 0x59, 0x45, 0x52, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0, 0x32, 0x30, 0x31, 0x33 };
            var    stream = new MemoryStream(data);

            var tags = MTag.Create(stream);

            tags.Year.Should().Be(2013);
        }
示例#2
0
        public void WhenLatin1EncodingIsUsed_TerminateStringOnNull()
        {
            byte[] data   = new byte[] { 0x49, 0x44, 0x33, 0, 0, 0, 0, 0, 0, 0x1B, 0x54, 0x49, 0x54, 0x32, 0, 0, 0, 0x7, 0x0, 0x0, 0, 0x54, 0x65, 0x73, 0x74, 0x0, 0x41 };
            var    stream = new MemoryStream(data);

            var tags = MTag.Create(stream);

            tags.Title.Should().Be("Test");
        }
示例#3
0
        public void WhenTestIsSetAsTitleTag_ReturnsTest()
        {
            byte[] data   = new byte[] { 0x49, 0x44, 0x33, 0, 0, 0, 0, 0, 0, 0x19, 0x54, 0x49, 0x54, 0x32, 0, 0, 0, 0x5, 0x0, 0x0, 0, 0x54, 0x65, 0x73, 0x74 };
            var    stream = new MemoryStream(data);


            var tags = MTag.Create(stream);

            tags.Title.Should().Be("Test");
        }
示例#4
0
        public void WhenMultipleTagsAreSet_ReturnsTheExpectedTags()
        {
            string[] input = File.ReadAllText("test.txt").Split(' ');
            var      data  = new byte[input.Length];

            for (int i = 0; i < data.Length; i++)
            {
                data[i] = (byte)int.Parse(input[i], System.Globalization.NumberStyles.HexNumber);
            }

            var stream = new MemoryStream(data);

            var tags = MTag.Create(stream);

            tags.Title.Should().Be("The Crutch");
            tags.Band.Should().Be("Billy Talent");
            tags.TrackNumber.Should().Be(3);
            tags.AmountOfTracksInSet.Should().Be(12);
            tags.AlbumName.Should().Be("Afraid of Heights");
            tags.SetNumber.Should().Be(1);
            tags.AmountOfSets.Should().Be(1);
            tags.Year.Should().Be(2016);
            tags.Genres.Should().Contain("Alternative & Punk");
        }