Exemplo n.º 1
0
        public void Setup()
        {
            //mockhttps://stackoverflow.com/questions/64794219/how-to-mock-iconfiguration-getvalue
            var inMemorySettings = new Dictionary <string, string> {
                { "TopLevelKey", "TopLevelValue" },
                { "ConnectionStrings:Production", "Data Source=ZIT-D0998\\SQL2014; Initial Catalog = salonfr2; Integrated Security = True; Connect Timeout = 30; Encrypt = False; TrustServerCertificate = False; ApplicationIntent = ReadWrite; MultiSubnetFailover = False" },
                //...populate as needed for the test
            };

            this.configuration = new ConfigurationBuilder()
                                 .AddInMemoryCollection(inMemorySettings)
                                 .Build();
            connectDB = SDependencyContainer.getCreatorOfDBConnection;
            // query
            accessQuery   = connectDB.CreateConnectForQuery_MSsql(configuration, "Production");
            getDataFromDB = new DataFromTable_With_Sync_and_Async <ModelEmployee>(accessQuery);
            //command
            command      = connectDB.CreateConnectForCommand_MSsql(configuration, "Production");
            execNonQuery = new CommandExecuteNonQuey <ModelEmployee>(command);
        }
Exemplo n.º 2
0
 public CommandExecuteNonQuey(ICreateAccessWithCommand createCommnad)
 {
     this.createCommnad = createCommnad;
 }