Example #1
0
 public bool ConvertContract(out string data)
 {
     if (_converterService.ConvertContract(Contract))
     {
         data = _converterService.GetConvertedCode();
         return(true);
     }
     else
     {
         data = _converterService.GetErrorMessage();
         return(false);
     }
 }
        public void SetConversionStrategyAndConvert_ShouldConvert()
        {
            var contract = new Contract {
                Name = "Hello world", Id = "Contract1"
            };
            var conversionStrategy = new MockConversionStrategy();

            _converterService.ConversionStrategy = conversionStrategy;

            var conversionResult = _converterService.ConvertContract(contract);

            Assert.True(conversionResult);
            Assert.Equal(contract.Name, _converterService.GetConvertedCode());
        }