Пример #1
0
        public void ShouldConvertServiceProjectIntoAProject()
        {
            var serviceProject = TranslatorHelper.CreateServiceProject();

            var project = DataServiceTranslator.ConvertToProject(serviceProject);

            TranslatorHelper.AssertProject(serviceProject, project);
        }
Пример #2
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]);
        }