/// ------------------------------------------------------------------------------------
        private void CreateSessionAndMockedPerson()
        {
            // Create a person
            var folder = Path.Combine(_tmpFolder.Path, Person.kFolderName);

            Directory.CreateDirectory(folder);
            folder = Path.Combine(folder, "ddo-person");
            Directory.CreateDirectory(folder);
            File.CreateText(Path.Combine(folder, "ddo-person.person")).Close();
            File.CreateText(Path.Combine(folder, "ddoPic.jpg")).Close();
            File.CreateText(Path.Combine(folder, "ddoVoice.wav")).Close();

            _person = new Mock <Person>();
            _person.Setup(p => p.FolderPath).Returns(Path.Combine(Path.Combine(_tmpFolder.Path, Person.kFolderName), "ddo-person"));
            _person.Setup(p => p.Id).Returns("ddo-person");
            _personMetaFile.Setup(m => m.GetStringValue(PersonFileType.kCode, It.IsAny <string>())).Returns("1");
            _personMetaFile.Setup(m => m.GetStringValue("privacyProtection", It.IsAny <string>())).Returns("false");
            _personMetaFile.Setup(m => m.GetStringValue("birthYear", It.IsAny <string>())).Returns("2000");
            _person.Setup(p => p.MetaDataFile).Returns(_personMetaFile.Object);


            _personInformant = new Mock <PersonInformant>();
            _personInformant.Setup(i => i.GetPersonByNameOrCode("ddo-person")).Returns(_person.Object);

            // Create a session
            var parentFolder = Path.Combine(_tmpFolder.Path, Session.kFolderName);

            Directory.CreateDirectory(parentFolder);
            folder = Path.Combine(parentFolder, "ddo-session");
            Directory.CreateDirectory(folder);
            File.CreateText(Path.Combine(folder, "ddo.session")).Close();
            File.CreateText(Path.Combine(folder, "ddo.mpg")).Close();
            _mp3FullName = Path.Combine(folder, "ddo.mp3");
            File.CreateText(_mp3FullName).Close();
            File.CreateText(Path.Combine(folder, "ddo.pdf")).Close();
            _session = new DummySession(parentFolder, "ddo", _personInformant.Object);

            // create a project file
            var projFileName = _dummyProjectName + Settings.Default.ProjectFileExtension;

            File.CreateText(Path.Combine(_tmpFolder.Path, projFileName)).Close();
        }
Exemple #2
0
        /// ------------------------------------------------------------------------------------
        private void CreateSessionAndMockedPerson()
        {
            // Create a person
            var folder = Path.Combine(_tmpFolder.Path, Person.kFolderName);

            Directory.CreateDirectory(folder);
            folder = Path.Combine(folder, "ddo-person");
            Directory.CreateDirectory(folder);
            File.CreateText(Path.Combine(folder, "ddo-person.person")).Close();
            File.CreateText(Path.Combine(folder, "ddoPic.jpg")).Close();
            File.CreateText(Path.Combine(folder, "ddoVoice.wav")).Close();

            _person = new Mock <Person>();
            _person.Setup(p => p.FolderPath).Returns(Path.Combine(Path.Combine(_tmpFolder.Path, Person.kFolderName), "ddo-person"));
            _person.Setup(p => p.Id).Returns("ddo-person");

            _personInformant = new Mock <PersonInformant>();
            _personInformant.Setup(i => i.GetPersonByNameOrCode("ddo-person")).Returns(_person.Object);

            // Create a session
            var parentFolder = Path.Combine(_tmpFolder.Path, Session.kFolderName);

            Directory.CreateDirectory(parentFolder);
            folder = Path.Combine(parentFolder, "ddo-session");
            Directory.CreateDirectory(folder);
            File.CreateText(Path.Combine(folder, "ddo.session")).Close();
            File.CreateText(Path.Combine(folder, "ddo.mpg")).Close();
            File.CreateText(Path.Combine(folder, "ddo.mp3")).Close();
            File.CreateText(Path.Combine(folder, "ddo.pdf")).Close();
            _session = new DummySession(parentFolder, "ddo", _personInformant.Object);

            // create a project file
            var projFileName = _dummyProjectName + Settings.Default.ProjectFileExtension;

            File.CreateText(Path.Combine(_tmpFolder.Path, projFileName)).Close();
        }