コード例 #1
0
        public void T2_View_Returns_Expected_Values_Programmaticaly()
        {
            using (SqlConnection connection = new SqlConnection(DbInit.GetDbConnectionString()))
            {
                connection.Open();

                ResetTable(connection);

                List <View> results = DbViews.GetViewValues(connection).ToList();

                Compare(results, GetAllUser()).Should().BeTrue();
            }
        }
コード例 #2
0
        public void T1_Create_StudentsView()
        {
            using (SqlConnection connection = new SqlConnection(DbInit.GetConnectionString()))
            {
                connection.Open();

                ScriptExecutor exe = new ScriptExecutor();
                exe.ScriptExe(DbViews.Views(), connection);

                string     cmdText   = @"USE itiSchoolDB IF EXISTS (SELECT * FROM sys.objects WHERE type = 'V' AND name = 'StudentsView') SELECT 1 ELSE SELECT 0";
                SqlCommand DateCheck = new SqlCommand(cmdText, connection);
                int        x         = Convert.ToInt32(DateCheck.ExecuteScalar());
                x.Should().Be(1);

                // Check if already Exist
                exe.ScriptExe(DbViews.Views(), connection);
            }
        }
コード例 #3
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger, ApplicationDbContext context, IHubContext <WeatherHub> hub)
 {
     _weatherHubContext = hub;
     _logger            = logger;
     _db = new DbViews(context);
 }