public void ThenTheResultShouldBe(string p0, Table table) { CurrencyMapping details = table.CreateInstance <CurrencyMapping>(); string cn = details.Currency; // Console.WriteLine(details.Currency); using (NpgsqlConnection con = GetConncection()) { con.Open(); string dataItems; if (con.State == ConnectionState.Open) { Console.WriteLine("Yeah Connected"); NpgsqlCommand command = new NpgsqlCommand("Select currency from public.transaction where currency = 'USA'", con); NpgsqlDataReader dr = command.ExecuteReader(); for (int i = 0; dr.Read(); i++) { dataItems = dr[0].ToString(); Console.WriteLine(dataItems); Console.WriteLine("Matching Actual vs Expected"); Console.WriteLine(dataItems.Equals(cn)); if (dataItems != cn) { throw new ArgumentNullException("scenario failed as Actual vs Expected didn't match"); } //try //{ // if (dataItems == cn) // { // Console.WriteLine("Expected result Match"); // } // else // { } // if (dataItems != p0) throw new ArgumentNullException("scenario failed"); // } //} //catch (Exception ex) //{ // Console.WriteLine("Message : " + ex.Message); // Console.WriteLine("Stack Trace : " + ex.StackTrace); //} } // while (dr.Read()) // Console.Write("{0}\t{1} \n", dr[0]); con.Close(); } } }
public void GivenCurrencyValueIsAU(Table table) { CurrencyMapping details = table.CreateInstance <CurrencyMapping>(); Console.WriteLine(details.Currency); }