Ejemplo n.º 1
0
        public DMNFixture()
        {
            _dmnPersistence = DefaultDMNPersistence.Instance;

            var assembly      = Assembly.GetExecutingAssembly();
            var resourceNames = assembly.GetManifestResourceNames();

            string xmlContent;

            foreach (var resourceName in resourceNames)
            {
                if (resourceName.Contains("DmnFiles") && resourceName.EndsWith("dmn"))
                {
                    var resourceStream = assembly.GetManifestResourceStream(resourceName);

                    using (TextReader textReader = new StreamReader(resourceStream, Encoding.UTF8)) {
                        xmlContent = textReader.ReadToEnd();
                    }

                    var splitNames = resourceName.Split('.');

                    _dmnPersistence.WriteDefinitions(splitNames[splitNames.Length - 2], xmlContent);
                }
            }

            var mockLogTrans = new Mock <ILogger <DMNTransformer> > ();
            ILogger <DMNTransformer> loggerTransfomer = mockLogTrans.Object;

            _dmnTransformer = new DMNTransformer(loggerTransfomer);

            var mockLogVal = new Mock <ILogger <DMNDefaultValidation> > ();
            ILogger <DMNDefaultValidation> loggerValidation = mockLogVal.Object;

            _dmnValidation = new DMNDefaultValidation(loggerValidation);

            _dmnRepository = new DMNRepository(_dmnTransformer, _dmnPersistence, _dmnValidation);

            _dmnDoer = new DMNDoer(_dmnRepository);
        }
Ejemplo n.º 2
0
 public DMNDoer(DMNRepository repository)
 {
     _repository = repository;
 }