public void set_up()
        {
            //setting connection options for dbcontext
            var mockOptions = new Mock <IOptions <ConnectionSettings> >();
            //runtime DB connection strings
            var settings = new ConnectionSettings
            {
                ConnectionString = Environment.GetEnvironmentVariable("MONGO_CONN_STRING") ??
                                   @"mongodb://localhost:1433/",
                CollectionName = "process-data",
                Database       = "mat-processes"
            };

            //make options mock return the object with settings
            mockOptions.SetupGet(x => x.Value).Returns(settings);

            //setting up dbcontext
            _dbcontext = new MatDbContext(mockOptions.Object);
            var processDataGateway   = new ProcessDataGateway(_dbcontext);
            var processDataUsecase   = new ProcessDataUseCase(processDataGateway);
            var postInitDocValidator = new PostInitialProcessDocumentRequestValidator();
            var updateDocValidator   = new UpdateProcessDocumentRequestValidator();
            var getDocValidator      = new GetProcessDocumentRequestValidator();
            Mock <ILogger <ProcessDataController> > logger = new Mock <ILogger <ProcessDataController> >();

            _processDataController = new ProcessDataController(processDataUsecase, logger.Object, postInitDocValidator, updateDocValidator, getDocValidator);
        }
Esempio n. 2
0
 public void SetUp()
 {
     _updateProcessDocValidator = new UpdateProcessDocumentRequestValidator();
     randomGuid = _faker.Random.Guid().ToString();
 }