Пример #1
0
 public MainViewModel(ITransformationFileService fileService, ITransformationService transformationService)
 {
     this.details                   = new TransformationDetails(@"C:\ArmTemplate\Output", true);
     this.ValidationErrors          = new ObservableCollection <ValidationError>();
     this.transformationFileService = fileService;
     this.transformationService     = transformationService;
 }
Пример #2
0
 public ImportService(IStorageAccess storageAccess, IQueueService queueService, ITransformationFileService transformationFileService, IOptions <TransformationSettings> transformationSettings)
 {
     _storageAccess             = storageAccess;
     _queueService              = queueService;
     _transformationFileService = transformationFileService;
     _transformationSettings    = transformationSettings.Value;
 }
Пример #3
0
        public void Setup()
        {
            this.reportedError                = null;
            this.userMessage                  = null;
            this.inputTemplate                = new InputDashboardArmTemplate("SomeJson");
            this.completeOutputTemplate       = new OutputDashboardArmTemplate("SomeOutputJson", "SomeParametersJson");
            this.partOfExistingTemplateOutput = new OutputDashboardArmTemplate("PartOutputJson", "SomeParametersJson");

            this.fileService           = A.Fake <ITransformationFileService>();
            this.transformationService = A.Fake <ITransformationService>();

            Messenger.Default.Register <Exception>(this, e => this.reportedError = e);
            Messenger.Default.Register <string>(this, e => this.userMessage      = e);
            this.mainViewModel = new MainViewModel(this.fileService, this.transformationService);
            this.mainViewModel.SourceFilePath   = @"C:\Input.json";
            this.mainViewModel.OutputFolderPath = OutputPath;

            A.CallTo(() => this.transformationService.Transform(this.inputTemplate, A <TransformationDetails> .That.Matches(x => x.DashboardIsCompleteTemplate.Equals(true)))).Returns(this.completeOutputTemplate);
            A.CallTo(() => this.transformationService.Transform(this.inputTemplate, A <TransformationDetails> .That.Matches(x => x.DashboardIsCompleteTemplate.Equals(false)))).Returns(this.partOfExistingTemplateOutput);
        }