public StoragePerson GetSQlData(string stringConnection, int _Id)
        {
            SqlConnection conn = new SqlConnection(stringConnection);
            conn.Open();
            Logger logger = LogManager.GetCurrentClassLogger();
            logger.Info("Inside");

            StoragePerson person = new StoragePerson();
            string sqlGetCmd = @"select Fname,Sname,telephone,email from Person where idPerson=@_Id";
            SqlCommand cmd = new SqlCommand(sqlGetCmd, conn);
            cmd.Parameters.AddWithValue("@_Id", _Id);
            SqlDataReader rdb = cmd.ExecuteReader();
            rdb.Read();
            //проверка на null
            person.IdStoragePerson = _Id;
            //if(rdb.IsDBNull())
            person.FName = (string)GetUnoSQlValue(rdb,"Fname");
            person.SName = (string)GetUnoSQlValue(rdb,"Sname");
            person.Telephone = (string)GetUnoSQlValue(rdb,"telephone");
            person.Email = (string)GetUnoSQlValue(rdb,"email");
            if (conn != null)
            {
                conn.Close();
                conn.Dispose();
            }
            else
            {
                logger.Warn("SQlConnection not close");
            }
            return person;
        }
        public void SetSQlData(string stringConnection, StoragePerson person)
        {
            SqlConnection conn = new SqlConnection(stringConnection);
            conn.Open();
            Logger logger = LogManager.GetCurrentClassLogger();
            logger.Info("Inside");

            string strInsert = @"insert into Person (Fname,Sname,telephone,email) values('@_Fname','@_Sname','@_telephone','@_email')";
            SqlCommand cmd = new SqlCommand(strInsert, conn);
            cmd.Parameters.AddWithValue("@_Fname", person.FName);
            cmd.Parameters.AddWithValue("@_Sname", person.SName);
            cmd.Parameters.AddWithValue("@_telephone", person.Telephone);
            cmd.Parameters.AddWithValue("@_email", person.Email);
            cmd.ExecuteNonQuery();
            if (conn != null)
            {
                conn.Close();
                conn.Dispose();
            }
            else
            {
                logger.Warn("SQlConnection not close");
            }
        }
 public void TestStoragePerson()
 {
     //Arrage
     IRepositoryPerson test = new RepositoryPerson();
     StoragePerson ob = new StoragePerson();
     //Act
     ob = test.GetSQlData(stringConnection, 2);
     //Assert
     Assert.AreEqual(null, ob.SName);
 }