예제 #1
0
        public void ShouldConvertToMediaBin()
        {
            var serviceContainer = TranslatorHelper.CreateServiceMediaBin();

            var container = DataServiceTranslator.ConvertToMediaBin(serviceContainer);

            TranslatorHelper.AssertContainer(serviceContainer, container);
        }
예제 #2
0
        public void ShouldConvertProjectIntoAServiceProject()
        {
            var project = TranslatorHelper.CreateProject();

            var serviceProject = DataServiceTranslator.ConvertToDataServiceProject(project);

            TranslatorHelper.AssertProject(project, serviceProject);
        }
예제 #3
0
        public void ShouldConvertCollectionOfTitleTemplatesIntoListOfTitleTemplates()
        {
            var serviceTitleTemplates = new ObservableCollection <TitleTemplate>();

            serviceTitleTemplates.Add(TranslatorHelper.CreateServiceTitleTemplate());
            serviceTitleTemplates.Add(TranslatorHelper.CreateServiceTitleTemplate());

            var titleTemplates = DataServiceTranslator.ConvertToTitleTemplates(serviceTitleTemplates);

            TranslatorHelper.AssertTitleTemplate(serviceTitleTemplates[0], titleTemplates[0]);
            TranslatorHelper.AssertTitleTemplate(serviceTitleTemplates[1], titleTemplates[1]);
        }
예제 #4
0
        public void ShouldConvertCollectionOfServiceProjectsIntoAListProjects()
        {
            var serviceProject1 = TranslatorHelper.CreateServiceProject();
            var serviceProject2 = TranslatorHelper.CreateServiceProject();

            var projectsCollection = new ObservableCollection <Project> {
                serviceProject1, serviceProject2
            };

            var projects = DataServiceTranslator.ConvertToProjects(projectsCollection);

            Assert.AreEqual(projectsCollection.Count, projects.Count);

            TranslatorHelper.AssertProject(projectsCollection[0], projects[0]);
            TranslatorHelper.AssertProject(projectsCollection[1], projects[1]);
        }