|
|
Debugging when running nunit.exe is a bit of a fiddle, you have to attach the debugger to the process. I believe there's a VS plugin these days though that allows you to execute NUnit tests with debugging enabled.
|
|
|
|
|
_Josh_ wrote: I tried resharper but uninstalled it as it changed my VS 2012 shortcuts without asking me.
Yes it does do that. I've even lost shortcuts when I've told it to use the Visual Studio Scheme.
_Josh_ wrote: Then I tried NUnit itself but for some reason unknown to anyone here it is not possible to debug the tests using NUnit.
As others have said, it is possible tp dp this.
An alternative is to use MS's unit testing framework for .net[^] the main drawbacks are you need VS Pro or above and any nunit tests you have are the wrong way round(actual/expected vs expected/actual) (though you'd have to refactor anyway). Other that the integration is pretty seamless.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
Sir Thomas More (1478 – 1535)
|
|
|
|
|
_Josh_ wrote: I'm just stunned at how bad this appears. Surely tests lose most of their value
when they are hard to execute?
You probably should read up on the philosophy of unit tests. The point isn't to allow you to debug it - not even close to that.
But the following process works if you can't get the IDE to work.
1. Determine something is failing.
2. Open the VS IDE and the project.
3. Add the following at a point that it relevant to the failure, perhaps at the top of the unit test.
System.Diagnostics.Debug.Assert(false);
4. Build in Debug mode.
5. Run the unit test with the GUI version of Nunit.
6. When it hits the above line it will pop a dialog asking if you want to debug the application and present you with your choice of debuggers. Pick the IDE from 2.
7. It will resolve itself to a break point marked in your IDE at the above line.
8. After that you can step through and do anything thing else the debugger allows.
Might note that I prefer the above process versus running unit tests in the IDE.
_Josh_ wrote: Is it possible to add a Main() to my test project and just run the tests?
Of course - after all that is exactly what the Nunit command line and GUI tools do.
|
|
|
|
|
hi everybody
am trying to understand interfaces .and i created a Console App with Two Classes( Somme and Tunnel) and an Interface called IAdd.
IAdd interface:
interface IAdd
{
int calc(int a,int b);
}
Somme Class that implement the IAdd interface:
class Somme : IAdd
{
public int calc(int a, int b)
{
return a + b;
}
}
Tunnel Class :
class Tunnel
{
IAdd som = new Somme();
som.calc(3,4);
}
but the MAin Console can use this writing.why i can't calculate the Somme and then send the result to the main Console.
Console Main:
static void Main(string[] args)
{
IAdd som = new Somme();
int x = som.calc(3, 4);
Console.WriteLine( x);
Console.ReadKey();
}
what's the point am missing here?
forget my english,am doing my best to learn many things .
|
|
|
|
|
i got it..i must do that in the constructor or in a method..
lke this
void Tunnel()
{
IAdd som = new Somme();
so
}
Silly Right ? Ooh Beginners...
|
|
|
|
|
how to write into text box from database query row values?
|
|
|
|
|
You can try this code:
SqlConnection conn = new SqlConnection(connectionStringArg);
SqlCommand command = new SqlCommand("select field from table");
command.Connection = conn;
conn.Open();
textbox.text = (string)command.ExecuteScalar();
conn.Close();
If you need more than the first column from the first row returned, you'll need to use ExecuteReader().
|
|
|
|
|
|
You do this by
1) Setting up a connection to the database using a connection string.
2) Using ADO.Net to write a parameterized query and then execute this query to fetch this data.
3) Displaying this in the text box.
|
|
|
|
|
I'm using google api 2.0 for .net. I use this code to create a new calendar:
CalendarEntry calendar = new CalendarEntry();
calendar.Title.Text = "Little League Schedule";
calendar.Summary.Text = "This calendar contains the practice schedule and game times.";
calendar.TimeZone = "America/Los_Angeles";
calendar.Hidden = false;
calendar.Color = "#2952A3";
calendar.Location = new Where("", "", "Oakland");
Uri postUri = new Uri("https://www.google.com/calendar/feeds/default/owncalendars/full");
CalendarEntry createdCalendar = (CalendarEntry) service.Insert(postUri, calendar);
but, on execution, return the error:
Execution of request failed
at the line
CalendarEntry createdCalendar = (CalendarEntry) service.Insert(postUri, calendar);
However, if I connect to google calendar with the browser, the new calendar is created.
Also, I use this code to retriving all calendars and it's works
CalendarQuery query = new CalendarQuery();
query.Uri = new Uri("https://www.google.com/calendar/feeds/default/allcalendars/full");
CalendarFeed resultFeed = (CalendarFeed) service.Query(query);
Any suggestions?? Thanks
|
|
|
|
|
Looks almost identical to the example from the manual. Did you call the authenticate-method of the service object?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
yes, the code is identical. I'm writing a test application.
For authentication I used this code:
CalendarService service = new CalendarService(companyName + "-" + applicationName + "-" + versionID);
service.setUserCredentials(_uid, _psw);
|
|
|
|
|
Multiple versions of the same libraries, some deprecated, some not. Poor documentation..
First tried your version of the sample, and it failed to work. Apparently the version of the assemblies do not match the ones described in the docs.
Download the SDK here; http://code.google.com/p/google-gdata/[^]
Next, download ILSpy, and open the binary called "Calender.exe" located under
C:\Program Files (x86)\Google\Google Data API SDK\Samples\
Open the SampleApp namespace and select the Calender-class. You'll get a decompiled version on the right-side of your screen. Expand each method to see it's body, copy & paste it to a test-project, and run
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I found the problem ... I set the property value calendar.TimeZone = "Italy / Rome" but the correct value is "Europe / Rome".
thanks!
|
|
|
|
|
Cool - you're welcome
|
|
|
|
|
How can i Import Data of a Dataview in wpf to MsWord
|
|
|
|
|
|
|
List lstusers = new List();
lstusers = AMSManagement.GetAllUsers();
var lnquser = from u in lstusers
show error here plz help me!!!
-------------
where u.User_ID == int.Parse(Session["UserID"].ToString()) && u.Pass_word == txtopwd.Text.Trim()
select u;
--------------------
if (lnquser.ToList().Count > 0)
{
users u = new users();
u.User_ID = int.Parse(Session["UserID"].ToString());
u.Pass_word = txtcnpwd.Text.Trim();
AMSManagement.Changepassword(u);
lblmsg.Text = "Password Changed Successfully!";
}
|
|
|
|
|
Are you very sure the session contains UserID?
Try with the following code:
where u.User_ID == int.Parse(Session["UserID"]==null? "0":Session["UserID"].ToString()) && u.Pass_word == txtopwd.Text.Trim()
|
|
|
|
|
List<users> lstusers = new List<users>();
lstusers = AMSManagement.GetAllUsers();
var lnquser = from u in lstusers
where u.User_ID == int.Parse(Session["UserID"] == null ? "0" : Session["UserID"].ToString())&& u.Pass_word==txtopwd.Text.Trim()
select u;
if (lnquser.ToList().Count > 0)
{
users u = new users();
u.User_ID = int.Parse(Session["UserID"].ToString());
u.Pass_word = txtcnpwd.Text.Trim();
AMSManagement.Changepassword(u);
lblmsg.Text = "Password Changed Successfully!";
}
else
{
lblmsg.Text = "plz enter valid old password!";
}
when i change code as your view then it execute else part
|
|
|
|
|
Could you please debug and check the value of Session["UserID"]
I think Session["UserID"] is not initiated.
|
|
|
|
|
|
Could you please post the code where are you setting the value of Session["UserID"]?
|
|
|
|