コード例 #1
0
        public void ValidateAddition(
            [Values(1, 0)] int x,
            [Values(2, 7)] int y)
        {
            int expectedResult = x + y;
            int actualResult   = runtime.Add(x, y);

            Assert.AreEqual(expectedResult, actualResult);
        }
コード例 #2
0
ファイル: BrowseMovie.cs プロジェクト: karthicbz/MoviesKart
        private void showBrowsedMovies(string movieName)
        {
            SqlConnection connection = new SqlConnection(ConnectionString);

            connection.Open();
            if (connection.State == ConnectionState.Open)
            {
                string     CoverQuery = "Select MediumCover From MovieSource Where Title='" + movieName + "'";
                SqlCommand command    = new SqlCommand(CoverQuery, connection);
                MPosterLinks.Add(command.ExecuteScalar().ToString());

                string     yearQuery   = "Select Year From MovieSource Where Title='" + movieName + "'";
                SqlCommand YearCommand = new SqlCommand(yearQuery, connection);
                Year.Add(YearCommand.ExecuteScalar().ToString());

                string     RuntimeQuery   = "Select RunTime From MovieSource Where Title='" + movieName + "'";
                SqlCommand RuntimeCommand = new SqlCommand(RuntimeQuery, connection);
                Runtime.Add(RuntimeCommand.ExecuteScalar().ToString());

                string     SevenQuery   = "Select sevenHdMovie From MovieSource Where Title='" + movieName + "'";
                SqlCommand SevenCommand = new SqlCommand(SevenQuery, connection);
                Sevenp.Add(SevenCommand.ExecuteScalar().ToString());

                string     TenQuery   = "Select TenHdMovie From MovieSource Where Title='" + movieName + "'";
                SqlCommand TenCommand = new SqlCommand(TenQuery, connection);
                Tenp.Add(TenCommand.ExecuteScalar().ToString());

                string     ThreedQuery   = "Select ThreedMovie From MovieSource Where Title='" + movieName + "'";
                SqlCommand ThreedCommand = new SqlCommand(ThreedQuery, connection);
                Threed.Add(ThreedCommand.ExecuteScalar().ToString());
            }
        }