Integration Testing Web Services Against A Testing Database?

Oct 27, 2010

I'm currently building a .net web application that uses WCF web services to allow a Flex front end to access the database.

I'm in the process of setting up some unit/integration style testing on the web services and am trying to work out the best way to allow the tests to access and modify data in a separate test database.

Currently, the connection string in my unit test project points to my testing database, and the connection string in my web services project points to my development database. However, as I am using Linq it appears that when I call the web service methods from my test class, it uses the development database connection string. I have looked into creating mock objects or in-memory database but I believe the same issue would occur.

Is there a way to get this to work, or is my entire idea about what I want incorrect, in which case is there a better way to set this up?

View 3 Replies


Similar Messages:

How To Integration Testing On Application Without Necessarily Running All The Tests Via The Browser

Jun 4, 2010

ASP.Net MVC - How should i do integration testing on an ASP.net MVC application without necessarily running all the tests via the browser?

View 1 Replies

Architecture :: Unit Testing - Testing Private Methods Using PrivateObject?

Feb 23, 2011

Recently for a class to implement unit test for one of its private methods I used PrivateObject by creating private accessor instead of refelection, to which i received a code review comment as below

"My main concern with Private Object is the use of object[] in constructor. It replaces strong typing enforced by compiler with JavaScript-style run-time error detection.Consequently , personally, I would not recommend it."

Comments above confused me beacuse as per my understanding reflection also needs the object[] to invoke any method.

View 2 Replies

Unit Testing - NullReferenceExpection In A Integration Test Project For A Nhibernate Solution?

Nov 19, 2010

i have a .NET 3.5 solution with an asp.net(web site) project with fluentnhibernate and it's test project(class library project).i've referenced the asp.net project in the test project and with all fluentnhibernate/nhibenate dlls.

What i fail to comprehend is that, on a run of a webform (hit from browser) let's say Test.aspx, building of schema is successfull and i could see the tables in my database.

here is the method i call on Test.aspx.cs

[code]....

So from my comment the NullReferenceException happens when accessing the connectionstring. I don't have the explanation on why that happens.

View 2 Replies

Web Testing Software - TFS And Visual Studio Testing Tool.

Jan 18, 2011

am working as a web developer in a company. I am not aware of anything related to testing. Our company is planning to buy some testing softwares. Presently we are working on ASP.NET. We will be working on PHP and JAVA in future. I need your help to find out the best but cost effective testing sofwares.on TFS and Visual Studio Testing tool.

View 2 Replies

.Net Web Services Testing Tool?

Aug 19, 2010

tools to test .net application web services.Using that tool i should able to know that web service is working or not and which methods or services exposing to the client.

View 6 Replies

Write Unit Testing Web Services - HttpContext

Oct 26, 2010

I want to write unit tests for a web service. I create my test project, reference my web project (not service reference, assembly reference), then write some code to test the web services - they work fine. However, there are some services which make sure the user is logged in to the web application by using HttpContext.Current.User.Identity.IsAuthenticated. In the context of the tests, there is no such thing as HttpContext, so the tests always fail. How should these kinds of web services be unit tested?

View 5 Replies

SQL Server :: Copy Database For Testing?

Feb 14, 2011

I am using VWD 2010 with SqlServer 2008. I would like to make an exact copy of my database for testing purposes only so I can test my site before I publish it, make sure everything works so I do not have to reset any tables in my main db.

View 1 Replies

What Is The Point Of Unit Testing

Apr 3, 2011

I have been looking at the unit testing topic and honestly I have never yet seen it in a live application.

Im a little foggy on the subject....
A simple example is if I am populating a listbox with data, I would know through debugging if the data is being populated and if it wasnt it would probably be easy to figure out why. Futhermore I couldnt possibly put it in production if it wasnt work so, why would I need to do a unit test? I dont see the point of it.

View 4 Replies

MVC :: Unit Testing View?

Mar 18, 2011

In MVC, the unit testing is primarily surrounding the controllers. The Model is rarely tested, and the View not at all. What is the consensus on this?

View 13 Replies

Using The Moq Framework To Do Unit Testing?

Feb 11, 2010

I'm using the Moq framework to do my unit testing. I'm following some really useful instructions outlined here to mock the httpcontext, specifically for the purposes of testing the url referrer:[URL]

Everything seems to compile fine, however when running the test I get the following error:

System.Web.HttpException: Invalid use
of SimpleWorkerRequest constructor.
Application path cannot be overridden
in this context. Please use
SimpleWorkerRequest constructor that
does not override the application
path..

When analyzing I find the error seems to be thrown at the following line:

var wr = new SimpleWorkerRequest("", "", "", "", writer); I'm not sure what to make of this. What is the SimpleWorkerRequest and how does it work in creating the HttpContext in Moq?? Why is my use of it invalid according to the debugger??

UPDATE: Here is the complete method I use taken from the website above

public static HttpContextBase FakeHttpContext()
{
var httpContext = new Mock<HttpContextBase>();
var request = new Mock<HttpRequestBase>();
var response = new Mock<HttpResponseBase>();
var session = new Mock<HttpSessionStateBase>();
var server = new Mock<HttpServerUtilityBase>();
var cookies = new HttpCookieCollection();
httpContext.Setup(x => x.Server).Returns(server.Object);
httpContext.Setup(x => x.Session).Returns(session.Object);
httpContext.Setup(x => x.Request).Returns(request.Object);
httpContext.Setup(x => x.Response).Returns(response.Object);
response.Setup(x => x.Cookies).Returns(cookies);
httpContext.SetupGet(x => x.Request.Url).Returns(new Uri("http://www.csuci.edu"));
httpContext.SetupGet(x => x.Request.UrlReferrer).Returns(new Uri("http://www.csuci.edu"));
//var writer = new StringWriter();
//var wr = new SimpleWorkerRequest("", "", "", "", writer);
//HttpContext.Current = new HttpContext(wr);
return httpContext.Object;
}

I commented out the problem lines, that seemed to fix it, but I'm still not sure what those lines were supposed to do and why they were causing error.

View 1 Replies

Is There A Performance Testing Tool For Dll's

Feb 18, 2010

I know red-gate's ANTS Performance Profiler but it works with source code. I have an ASP.NET web application that is deployed on a remote server. I'm going to test its performance while it is working on the server.

My main goal is to detect what method of what class is slow and then is a bottleneck. Is there a way or a tool?

View 1 Replies

Which Testing Frameworks To Use For Web App Websites

Oct 26, 2010

I use visual studio 2005 and now my team wants me to try my hand at some testing frameworks for asp.net websites.I'm completely new to testing. I want to know what kind of automated testing can I do.Can I test my business logic,Can I test my UI.I just started using NUnit and I am getting a hang of it. For Web UI testing I've tried Nunit asp.Somewhere I found about Selenium, which of this is better.Also is there an add-in to test Javascript code with NUnit.Is there an better alternative to NUnit.

View 1 Replies

MVC :: Breakpoints Not Getting Hit In Unit Testing?

Mar 2, 2010

I created a new ASP.NET MVC application and the accompanying unit tests that can be generated automatically. I created a new Controller method and tried to wire up a test. The test failed, and I tried to step through the test code to find out the state of certain variables. The breakpoint showed as being set, but it never was hit.

I did a Google search on this, and there are many other people wondering the same thing - why doesn't this work? The answers have been sketchy at best. The most proliferant seems to be that the unit tests are run in the production configuration instead of the debug configuration, and so several steps are required to get breakpoints to work. Seriously? This is something I would expect to be enabled by default. What good is test code you can't step through? Why create a set of unit tests that require you to jump through several hoops to get this very basic feature running? NUnit (and I suppose others) don't have this issue.

how to get the breakpoints to work were completely different than all the others, and I'd like to know if anyone has an idea of how to enable debugging of the unit tests that are included in Visual Studio 2008.

View 4 Replies

What Is The Best Unit Testing Framework For C# 3.5

Mar 21, 2011

I would like to have information on the available unit testing frameworks in .NET realm. Especially the ones which are suitable for ASP.NET (C# .NET 3.5).

View 3 Replies

Unit Testing ProfileBase In C#?

Aug 10, 2010

I need to implement my own Profile properties and was going to inherit from System.Web.Profile.ProfileBase to achieve this.

What I don't understand is how to best unit test this Profile class in isolation without hitting the database.

View 1 Replies

How To Start With Unit Testing

Jan 27, 2011

I'd like to write some code and then just write the unit tests for the important stuff.

I know the tools. I know how to write a unit test.

I wrote some code (couple off classes) and I don't know where to start. I'm missing the semantic.

How to pick up what to unit test ?

Should I unit test every class extra ?

Should I try to simulate every possible variation of method's parameters ?

View 2 Replies

Best Web Testing Tool Have You Found For C#??

Feb 23, 2010

I've been investigating a few of them.What I have found so far that seems usable.

Windmill
Selenium
Watin

Windmill looks like it has the basics (still not sure if I can write C# unit tests with it)Watin seems awesome with Unit tests..of the 3, it looks like Selenium is trying to be the most fully featured af the 3 (most recent version is today!)

View 2 Replies

C# - Use For Doing Local MySQL Testing?

Apr 4, 2011

I want to test MySQL with ASP .NET locally. However, I do not want to host a local server. How would I simulate a local MySQL server using files or something similar?

View 4 Replies

MVC :: Testing ActionResult.ExecuteResult?

Jan 15, 2010

I have the following action result class that looks for a content type of "application/json" in the request and executes a jsonresult or the default result. My problem is that I don't know how to test the ExecuteResult method.This is the method in question:

[Code]....

View 1 Replies

Testing A Windows Service?

Nov 5, 2010

using vb.net 2005.

what is the best and easiest way to test a windows service while developing it?

View 5 Replies

C# - Testing If URL And Querystring Is Valid?

May 13, 2010

What is the best way to test if a url & querystring is valid? For example, after a login redirect I want to make sure the target url is valid. If not, go to a default page.

We seem to have a problem with the querystring, starting with "ReturnUrl=", being duplicated and that throws an exception. We'd rather have it go to a default page.

View 3 Replies

Testing Mobile On Local Network?

Aug 30, 2010

I do not want to do my development based on an emulator, so I want to be able to have my phone (Android), to connect to my local PC to make sure what I am developing comes out the way I want it to.

Issue #1 - I need to be able to connect to my network, not internet, I can't have my PC internet facing, this limits me from opening my PC to the internet.

Issue #2 - No WiFi allowed at my work, security issues.

Issue #3 - I can't publish this to a internet facing site, since the procedure to get it to one, take a few days each publish and will put my development to a crawl.

What I'm looking for, is a way to get my phone to connect to my local PC, maybe via USB/Bluetooth but have access to my local IIS.

View 3 Replies

Mocking HttpSessionState In .net For Nunit Testing

Mar 28, 2011

I've see n a lot of discussions surrounding HttpSessionState and asp.net MVC.I'm trying to write tests for an asp.net application and to mock the HttpSessionState and if so, how?I'm currently using Rhino Mocks and Nunit

View 1 Replies

How To Implement Unit Testing For A .Net Web Application

Sep 3, 2010

I want to imlement the Unit Testing in my asp.net web application.How to identify the scope of this. I mean, How should i start on this front.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved