public void Ctor_SetsPropertiesToCurrentBagProperties(string fileName, bool firstHeaders, bool exportEdgeAttributes, int nodeMapIndex, int edgeMapIndex) { _Bag.FileName = fileName; _Bag.ExportNodeAttributes = firstHeaders; _Bag.ExportEdgeAttributes = exportEdgeAttributes; Guid id = Guid.NewGuid(); _View = new PajekWriterParamsCtrl(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); Assert.Equal(_Bag.DefaultNodeMapIndex_ParamName, _View._DefaultNodeMapIndex_ParamName); Assert.Equal(_Bag.DefaultEdgeMapIndex_ParamName, _View._DefaultEdgeMapIndex_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); Assert.Equal(_Bag.DefaultNodeMapIndexDefault, _View._DefaultNodeMapIndexDefault); Assert.Equal(_Bag.DefaultEdgeMapIndexDefault, _View._DefaultEdgeMapIndexDefault); // "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); Assert.Equal(_Bag.DefaultNodeMapIndex, _View.LastDefaultNodeMapIndex); Assert.Equal(_Bag.DefaultEdgeMapIndex, _View.LastDefaultEdgeMapIndex); // 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); Assert.Equal(_View.DefaultNodeMapIndex, _View.LastDefaultNodeMapIndex); Assert.Equal(_View.DefaultEdgeMapIndex, _View.LastDefaultEdgeMapIndex); }
public void SetUp() { _Bag = new PajekWriterParamBag(); this._View = new PajekWriterParamsCtrl(Guid.NewGuid(), _Bag); }
public void Ctor_SetsPropertiesToBagDefaults() { Guid id = Guid.NewGuid(); _View = new PajekWriterParamsCtrl(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); Assert.Equal(_Bag.DefaultNodeMapIndex_ParamName, _View._DefaultNodeMapIndex_ParamName); Assert.Equal(_Bag.DefaultEdgeMapIndex_ParamName, _View._DefaultEdgeMapIndex_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); Assert.Equal(_Bag.DefaultNodeMapIndexDefault, _View._DefaultNodeMapIndexDefault); Assert.Equal(_Bag.DefaultEdgeMapIndexDefault, _View._DefaultEdgeMapIndexDefault); // "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); Assert.Equal(_Bag.DefaultNodeMapIndex, _View.LastDefaultNodeMapIndex); Assert.Equal(_Bag.DefaultEdgeMapIndex, _View.LastDefaultEdgeMapIndex); // 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); Assert.Equal(_View.DefaultNodeMapIndex, _View.LastDefaultNodeMapIndex); Assert.Equal(_View.DefaultEdgeMapIndex, _View.LastDefaultEdgeMapIndex); }