public void Ctor_SetsPropertiesToCurrentBagProperties(string fileName, bool firstHeaders, bool exportEdgeAttributes) { _Bag.FileName = fileName; _Bag.ExportNodeAttributes = firstHeaders; _Bag.ExportEdgeAttributes = exportEdgeAttributes; Guid id = Guid.NewGuid(); _View = new VNAWriterParamsCtrl(id, _Bag); // local copies of param names are set Assert.Equal(_Bag.FileName_ParamName, _View._FileName_ParamName); Assert.Equal(_Bag.ExportNodeAttributes_ParamName, _View._ExportNodeAttributes_ParamName); Assert.Equal(_Bag.ExportEdgeAttributes_ParamName, _View._ExportEdgeAttributes_ParamName); // local copies of default values are set Assert.Equal(_Bag.FileNameDefault, _View._FileNameDefault); Assert.Equal(_Bag.ExportNodeAttributesDefault, _View._ExportNodeAttributesDefault); Assert.Equal(_Bag.ExportEdgeAttributesDefault, _View._ExportEdgeAttributesDefault); // "Last" values are set to the bag's CURRENT valus Assert.Equal(_Bag.FileName, _View.LastFileName); Assert.Equal(_Bag.ExportNodeAttributes, _View.LastExportNodeAttributes); Assert.Equal(_Bag.ExportEdgeAttributes, _View.LastExportEdgeAttributes); // View's properties are set to the just set view last values Assert.Equal(_View.FileName, _View.LastFileName); Assert.Equal(_View.ExportNodeAttributes, _View.LastExportNodeAttributes); Assert.Equal(_View.ExportEdgeAttributes, _View.LastExportEdgeAttributes); }
public void SetUp() { _Bag = new VNAWriterParamBag(); this._View = new VNAWriterParamsCtrl(Guid.NewGuid(), _Bag); }
public void Ctor_SetsPropertiesToBagDefaults() { Guid id = Guid.NewGuid(); _View = new VNAWriterParamsCtrl(id, _Bag); // local copies of param names are set Assert.Equal(_Bag.FileName_ParamName, _View._FileName_ParamName); Assert.Equal(_Bag.ExportNodeAttributes_ParamName, _View._ExportNodeAttributes_ParamName); Assert.Equal(_Bag.ExportEdgeAttributes_ParamName, _View._ExportEdgeAttributes_ParamName); // local copies of default values are set Assert.Equal(_Bag.FileNameDefault, _View._FileNameDefault); Assert.Equal(_Bag.ExportNodeAttributesDefault, _View._ExportNodeAttributesDefault); Assert.Equal(_Bag.ExportEdgeAttributesDefault, _View._ExportEdgeAttributesDefault); // "Last" values are set to the bags CURRENT valus Assert.Equal(_Bag.FileName, _View.LastFileName); Assert.Equal(_Bag.ExportNodeAttributes, _View.LastExportNodeAttributes); Assert.Equal(_Bag.ExportEdgeAttributes, _View.LastExportEdgeAttributes); // Views Accessible values are set to the last values Assert.Equal(_View.FileName, _View.LastFileName); Assert.Equal(_View.ExportNodeAttributes, _View.LastExportNodeAttributes); Assert.Equal(_View.ExportEdgeAttributes, _View.LastExportEdgeAttributes); }