Exemplo n.º 1
0
        public void Test_Creation()
        {
            var diff = new Diff { FileNameValue = "1", TagValue = "2" };

            Assert.AreEqual(diff.FileNameValue, "1");
            Assert.AreEqual(diff.TagValue, "2");
        }
Exemplo n.º 2
0
        //TODO: move to separate class {READY}
        public UserData GetInfoFromUser(TagType tag, Diff diff, IMp3File file, ICommunication communication)
        {
            communication.SendMessage($"File: {file.FilePath}");
            communication.SendMessage($"There is a problem with tag \"{tag}\". ");
            communication.SendMessage(
                $"You can enter tag from: \n\t1) File name (Data: \"{diff.FileNameValue}\"), \n\t2) Mp3 Tags (Data: \"{diff.TagValue}\"), \n\t3) Manual");

            while (true)
            {
                communication.SendMessage("Your choise (number): ");
                SyncActions inputData;
                var choiseCorrect = Enum.TryParse(communication.GetResponse(), out inputData);
                if (!choiseCorrect)
                {
                    communication.SendMessage("Wrong input!");
                    communication.SendMessage("You sholud enter number with action!");
                    continue;
                }

                switch (inputData)
                {
                    case SyncActions.FromFileName:
                        return new UserData(inputData, diff.FileNameValue);
                    case SyncActions.FromTags:
                        return new UserData(inputData, diff.TagValue);
                    case SyncActions.Manual:
                        communication.SendMessage("Enter text for tag \"" + tag + "\"");
                        return new UserData(inputData, communication.GetResponse());
                }
            }
        }
Exemplo n.º 3
0
 public void TestInit()
 {
     _mp3File = new TestMp3File("/test");
     _fileDiff = new FileDifferences(_mp3File);
     _d1 = new Diff { FileNameValue = "1", TagValue = "2" };
     _d2 = new Diff { FileNameValue = "art1", TagValue = "art2" };
     _fileDiff.Add(TagType.Id, _d1);
     _fileDiff.Add(TagType.Artist, _d2);
 }
Exemplo n.º 4
0
 public void Add(TagType type, Diff differeceTags)
 {
     Diffs.Add(type, differeceTags);
 }