public void Validate(CSharpCompilation compilation, CSharpSyntaxTree tree, SemanticModel model,
                             Assembly assembly)
        {
            var taskdata = "TaskData";

            CSharpCommonValidator.ValidateClass(tree, model, taskdata);

            List <Property> propertiesToValidate = Lesson2CommonValidator.CreateStep5Properties();

            CSharpCommonValidator.ValidateProperties(tree, model, propertiesToValidate);
        }
        public void Validate(CSharpCompilation compilation, CSharpSyntaxTree tree, SemanticModel model,
                             Assembly assembly)
        {
            Lesson2CommonValidator.ValidateAddTaskMethod(compilation, tree, model, assembly);

            var methodName = "CompleteTask";

            CSharpCommonValidator.ValidateMethod(tree, model, methodName);

            ValidatorsExtensions.ExecuteSafe(() =>
            {
                var viewModel    = (dynamic)assembly.CreateInstance("DotvvmAcademy.Tutorial.ViewModels.Lesson2ViewModel");
                var task         = (dynamic)assembly.CreateInstance("DotvvmAcademy.Tutorial.ViewModels.TaskData");
                task.Title       = "New Task";
                task.IsCompleted = false;
                viewModel.CompleteTask(task);

                if (!task.IsCompleted)
                {
                    throw new CodeValidationException(Lesson2Texts.CompleteTaskMethodError);
                }
            });
        }
Exemple #3
0
 public void Validate(ResolvedTreeRoot resolvedTreeRoot)
 {
     Lesson2CommonValidator.ValidateRepeaterTemplate3(resolvedTreeRoot);
 }
Exemple #4
0
 public void Validate(CSharpCompilation compilation, CSharpSyntaxTree tree, SemanticModel model,
                      Assembly assembly)
 {
     Lesson2CommonValidator.ValidateAddTaskMethod(compilation, tree, model, assembly);
 }
Exemple #5
0
 public void Validate(ResolvedTreeRoot resolvedTreeRoot)
 {
     Lesson2CommonValidator.ValidateAddTaskControlBindings(resolvedTreeRoot);
 }
Exemple #6
0
 public void Validate(ResolvedTreeRoot resolvedTreeRoot)
 {
     Lesson2CommonValidator.ValidateRepeaterControl(resolvedTreeRoot);
 }