private CallSetupCurrencyWithParameters ( |
||
propertyType | ||
gridColumn | IUIGridColumn | |
gridViewColumn | IDataGridViewColumn | |
리턴 | void |
public void TestInitGrid_UIDef_CurrencyFormat_DataTypeDecimal_ShouldFormatColumn() { //---------------Set up test pack------------------- GridBaseInitialiserSpy gridInitialiser = new GridBaseInitialiserSpy(MockRepository.GenerateStub <IGridBase>(), MockRepository.GenerateStub <IControlFactory>()); IUIGridColumn gridColumn = MockRepository.GenerateStub <IUIGridColumn>(); string expectedFormat = "fdafasdfsda"; gridColumn.Stub(column => column.GetParameterValue("currencyFormat")).Return(expectedFormat); IDataGridViewColumn gridViewColumn = MockRepository.GenerateStub <IDataGridViewColumn>(); gridViewColumn.DefaultCellStyle = MockRepository.GenerateStub <IDataGridViewCellStyle>(); //--------------Assert PreConditions---------------- Assert.AreNotEqual(expectedFormat, gridViewColumn.DefaultCellStyle.Format); //---------------Execute Test ---------------------- gridInitialiser.CallSetupCurrencyWithParameters(typeof(Decimal), gridColumn, gridViewColumn); //---------------Test Result ----------------------- Assert.AreEqual(expectedFormat, gridViewColumn.DefaultCellStyle.Format); }
public void TestInitGrid_UIDef_CurrencyFormat_DataTypeDecimal_ShouldFormatColumn() { //---------------Set up test pack------------------- GridBaseInitialiserSpy gridInitialiser = new GridBaseInitialiserSpy(MockRepository.GenerateStub<IGridBase>(), MockRepository.GenerateStub<IControlFactory>()); IUIGridColumn gridColumn = MockRepository.GenerateStub<IUIGridColumn>(); string expectedFormat = "fdafasdfsda"; gridColumn.Stub(column => column.GetParameterValue("currencyFormat")).Return(expectedFormat); IDataGridViewColumn gridViewColumn = MockRepository.GenerateStub<IDataGridViewColumn>(); gridViewColumn.DefaultCellStyle = MockRepository.GenerateStub<IDataGridViewCellStyle>(); //--------------Assert PreConditions---------------- Assert.AreNotEqual(expectedFormat, gridViewColumn.DefaultCellStyle.Format); //---------------Execute Test ---------------------- gridInitialiser.CallSetupCurrencyWithParameters(typeof (Decimal), gridColumn, gridViewColumn); //---------------Test Result ----------------------- Assert.AreEqual(expectedFormat, gridViewColumn.DefaultCellStyle.Format); }