public void ExtractData_HasInitialize() { var reader = new UIEntityBehaviourReader(); var entity = reader.ExtractData(FileText); entity.EntityBehaviours.ShouldContain(m => m.Type == Omnia.CLI.Commands.Model.Apply.Data.UI.UIBehaviourType.Initialize); }
public void ExtractData_EmptyMethodsAreIgnored() { var reader = new UIEntityBehaviourReader(); var entity = reader.ExtractData(FileText); entity.EntityBehaviours.ShouldNotContain(m => string.IsNullOrEmpty(m.Expression)); }
public void ExtractData_Successfully() { var reader = new UIEntityBehaviourReader(); var entity = reader.ExtractData(FileText); entity.EntityBehaviours.ShouldNotBeNull(); entity.EntityBehaviours.Count.ShouldBe(7); }
public void ExtractData_WithBeforeSave_ValidExpression() { var reader = new UIEntityBehaviourReader(); var beforeSave = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Name.Equals("onBeforeSave")); beforeSave.Expression.ShouldBe("this._description = 'Hello world 9!';"); }
public void ExtractData_WithBeforeSave_ValidType() { var reader = new UIEntityBehaviourReader(); var beforeSave = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Name.Equals("onBeforeSave")); beforeSave.Type.ShouldBe(Omnia.CLI.Commands.Model.Apply.Data.UI.UIBehaviourType.BeforeSave); }
public void ExtractData_WithAfterChange_ValidExpression() { var reader = new UIEntityBehaviourReader(); var afterChange = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Name.Equals("onAfterChange")); afterChange.Expression.ShouldBe("this._description = 'Hello world 8!';"); }
public void ExtractData_WithAfterChange_ValidType() { var reader = new UIEntityBehaviourReader(); var afterChange = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Name.Equals("onAfterChange")); afterChange.Type.ShouldBe(Omnia.CLI.Commands.Model.Apply.Data.UI.UIBehaviourType.AfterChange); }
public void ExtractData_WithPropertyChange_CorrectAttribute() { var reader = new UIEntityBehaviourReader(); var initialize = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Name.Equals("WarehouseForm_onChange__code")); initialize.Element.ShouldBe("_code"); }
public void ExtractData_WithPropertyChange_ValidType() { var reader = new UIEntityBehaviourReader(); var initialize = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Name.Equals("WarehouseForm_onChange__code")); initialize.Type.ShouldBe(Omnia.CLI.Commands.Model.Apply.Data.UI.UIBehaviourType.Change); }
public void ExtractData_ValidType() { var reader = new UIEntityBehaviourReader(); var initialize = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Name.Equals("Initializer")); initialize.Type.ShouldBe(Omnia.CLI.Commands.Model.Apply.Data.UI.UIBehaviourType.Initialize); }
public void ExtractData_UsesCommentDescription() { var reader = new UIEntityBehaviourReader(); var initialize = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Type == Omnia.CLI.Commands.Model.Apply.Data.UI.UIBehaviourType.Initialize); initialize.Description.ShouldBe($"Initialize description"); }
public void ExtractData_ValidExpression() { var reader = new UIEntityBehaviourReader(); var initialize = reader.ExtractData(FileText) .EntityBehaviours .First(m => m.Type == Omnia.CLI.Commands.Model.Apply.Data.UI.UIBehaviourType.Initialize); initialize.Expression.ShouldBe("this._description = 'Hello world 4!';"); }