public bool ConvertContract(out string data) { if (_converterService.ConvertContract(Contract)) { data = _converterService.GetConvertedCode(); return(true); } else { data = _converterService.GetErrorMessage(); return(false); } }
public void SetConversionStrategyAndConvertWithoutId_ShouldError() { var contract = new Contract { Name = "Hello world" }; var conversionStrategy = new MockConversionStrategy(); _converterService.ConversionStrategy = conversionStrategy; var conversionResult = _converterService.ConvertContract(contract); Assert.False(conversionResult); Assert.Equal("Id is not defined", _converterService.GetErrorMessage()); }