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; }
public ImportService(IStorageAccess storageAccess, IQueueService queueService, ITransformationFileService transformationFileService, IOptions <TransformationSettings> transformationSettings) { _storageAccess = storageAccess; _queueService = queueService; _transformationFileService = transformationFileService; _transformationSettings = transformationSettings.Value; }
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); }