Unit Testing of web page loading
-
public void abcMethod1() { string cspurl = @"http://xyz.aspx"; bool expected = true; bool actual; actual = @"http://xyz.aspx"; Assert.AreEqual(expected, actual, ""); } Here actual Value means, what could i assign for actual variable as am getting mismatch error, as i assigned string value to bool variable.
-
public void abcMethod1() { string cspurl = @"http://xyz.aspx"; bool expected = true; bool actual; actual = @"http://xyz.aspx"; Assert.AreEqual(expected, actual, ""); } Here actual Value means, what could i assign for actual variable as am getting mismatch error, as i assigned string value to bool variable.
-
Why are you testing a string value to a bool? Don't you mean: Assert.IsTrue(cspurl==actual, "Check string equality");
even then am getting an error, "Operator '==' cannot be applied to operands of type 'bool' and 'string'", if i use the Assert.IsTrue(cspurl==actual,"Check string equality");
-
even then am getting an error, "Operator '==' cannot be applied to operands of type 'bool' and 'string'", if i use the Assert.IsTrue(cspurl==actual,"Check string equality");
-
public void abcMethod1() { string cspurl = @"http://xyz.aspx"; bool expected = true; bool actual; actual = @"http://xyz.aspx"; Assert.AreEqual(expected, actual, ""); } Here actual Value means, what could i assign for actual variable as am getting mismatch error, as i assigned string value to bool variable.
public void abcMethod1()
{
string expected = @"http://xyz.aspx";
string actual = ...; // get the actual value here
Assert.AreSame(expected, actual);
}Tech, life, family, faith: Give me a visit. I'm currently blogging about: Check out this cutie The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
public void abcMethod1() { string cspurl = @"http://xyz.aspx"; bool expected = true; bool actual; actual = @"http://xyz.aspx"; Assert.AreEqual(expected, actual, ""); } Here actual Value means, what could i assign for actual variable as am getting mismatch error, as i assigned string value to bool variable.
I probably don't understand this, but from when we can assign string values to bool (which is always true or false) data value type ?! If you need compare two strings (use string's .Equals function) : string ww1 = @"http://xyz.aspx"; string ww2 = @"http://xyz.aspx"; if (ww1.Equals(ww2)) { // oh yes :) }
VirtualVoid**.NET**