public ModelBuilder(IModel model) { this.model = model as CobolModel; if (this.model == null) { throw new ArgumentException("model is not the correct type: " + model.GetType()); } }
public ModelBuilder(IModel model) { this.model = model as CobolModel; if (this.model == null) { throw new ArgumentException("model is not the correct type: " + model.GetType()); } }
private void AssertCobolModel(IModel model, string path, string name, string value) { Assert.That(model, Is.Not.Null, "Model is null"); IModel iModel = model as IModel; Assert.That(iModel, Is.Not.Null, "Not iModel"); if (iModel != null) { IModel selected = iModel.GetModel(path); Assert.That(selected, Is.Not.Null, "Selected: {0}", path); CobolModel cobolModel = selected as CobolModel; Assert.That(cobolModel, Is.Not.Null, "Selected: {0} is {1}", path, cobolModel); if (cobolModel != null) { Assert.That(cobolModel.Name, Is.EqualTo(name), path); Assert.That(cobolModel.Data, Is.EqualTo(value), path); } } }