While testing the payment gateway for some eCommerce site, is there any way to check if the cookies are saving the user's credit card details? If so, can we verify if they are in encrypted form?
To check if a type is a subclass of another type in C#, it's easy:
typeof (SubClass).IsSubclassOf(BaseClass); // returns true
However, this will fail:
typeof (BaseClass).IsSubclassOf(BaseClass); // returns false
Is there any way to check whether a type is either a subclass OR of the base class itself, without using an OR operator or using an extension method?
Hello everybody.
My current career is in software testing, but I feel that I am wasting my time, maybe because I don't know the future path of this career, and where I will arrive in the future if I continue in this career. And I don't know how can I develop myself in this career. Can I have my own job in this field? Please give me good suggestions and opinion.
Many thanks.
I am looking for good books and articles on user-interface testing.
What they should contain (one or more of):
different test methods/strategies
examples, use cases
naming pros and cons for different methods
something important I might have forgotten :-)
What they should not be:
Only about general tests and not gui tests
describing a test framework limited to a single language
What are the best resources you know of?
(preferably language agnostic)
Hi All,
What would be the ultimate web application browser compatibility test machine be? The testing environment would be (XP: IE6,FF3.6), (XP: IE7,Chrome), (XP: IE8,Safari), (MacOsX: Safari, FF3.6, Chrome), (Ubuntu: FF3.6, Chrome)
Of course I want it all in one machine, my initial thought was Using a MacOsX as a host machine and use virtual box to install 3 xp and one ubuntu on it.
Do you think it is an optimal solution? Do you have any better solution to achieve the above?
When invoking
[System.Configuration.ConfigurationManager]::GetSection("MySection")
from within a PowerShell prompt, it throws an exception because the assembly containing the type represented by "MySection" in the app config is unable to be loaded. However, I have previously loaded the assembly containing that type, and I am even able to instantiate the type directly using 'new-object'.
How is the ConfigurationManager resolving types such that the assemblies already loaded into the PowerShell app domain are not visible to it?
I want to have a test that testing the inexistent of this http headers, using NAnt and NUnit:
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Edit: I'm asking hot to actually test this rule: "don't have asp headers". so, I can have this test in each new website that I'm doing, so it make it easier no to forget this simple step.
Could dynamically be got a pointer to a type?
type foo struct {
A uint8
B string
}
func Testing() (*foo) {...}
Using an interface?
func Testing() (*interface{}) {...}
I've been working with a document repository using XQuery (via Java and .NET interfaces) and was wondering if anyone has any recommendations for unit testing XQuery modules?
whenever i run the unit testing application to find whether appdelegate is there r not using the test suit
-(void)testAppDelegate
{
id app_delegate=[[UIApplication sharedApplication]delegate];
STAssertNotNil(app_delegate,@"delegate not found");
}
i got this error. Please help.
"_OBJC_CLASS_$_UIApplication", referenced from:
objc-class-ref-to-UIApplication in Tests.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I migrated from Java to C# and so I am wondering how to unit tests in C#. I remember using JUnit to test my Java applications and importing the package, etc. How can I unit test in C#? What are some good resources for unit testing in C#?
If all the business logic is present in a datamodule (TSQLDataSets and TDataSetProviders) how would you refactor the code to make the application more appropiate for unit testing?
Let say I have written a small program that reads file_A and file_B as input data of test_case_A and test_case_B, passes the input to component_X which needs to be test, then verifies result against predefined expectation. That component_X could be in the same process, or different process on another machine.
I try to learn more about testing, but confused by various terms. Take above scenario as example, which of them is fixture/mock/harness/stub? Thanks.
Looking for a tool to UI testing on Linux .Platform used for development is django.
The idea is that the analysts will capture the tests thru some UI and it will be able to be played back over and over again.
Hi,
i have a little problem implementing some serialization/deserialization logic.
I have several classes that each take a different type of Request object, all implementing a common interface and inheriting from a default implementation:
This is how i think it should be:
Requests
interface IRequest
{
public String Action {get;set;}
}
class DefaultRequest : IRequest
{
public String Action {get;set;}
}
class LoginRequest : DefaultRequest
{
public String User {get;set;}
public String Pass {get;set;}
}
Handlers
interface IHandler<T>
{
public Type GetRequestType();
public IResponse HandleRequest(IModel model, T request);
}
class DefaultHandler<T> : IHandler<T> // Used as fallback if the handler cannot be determined
{
public Type GetRequestType()
{
return /* ....... how to get the Type of T? ((new T()).GetType()) ? .......... */
}
public IResponse HandleRequest(IModel model, T request)
{
/* ... */
}
}
class LoginHandler : DefaultHandler<LoginRequest>
{
public IResponse HandleRequest(IModel mode, LoginRequest request)
{
}
}
Calling
class Controller
{
public ProcessRequest(String action, String serializedRequest)
{
IHandler handler = GetHandlerForAction(action);
IRequest request = serializer.Deserialize<handler.GetRequestType()>(serializedRequest);
handler(this.Model, request);
}
}
Is what i think of even possible?
My current Solution is that each handler gets the serialized String and is itself responsible for deserialization. This is not a good solution as it contains duplicate code, the beginning of each HandleRequest method looks the same (FooRequest request = Deserialize(serializedRequest); + try/catch and other Error Handling on failed deserialization).
Embedding type information into the serialized Data is not possible and not intended.
Thanks for any Hints.
I need to write two versions of the same application, one in .NET and the other one in Java.
So I'd like to write a single test suite, and then use it against both codebases.
Which testing tool would you advise me to use?
We have a convention to validate all parameters of constructors and public functions/methods. For mandatory parameters of reference type, we mainly check for non-null and that's the chief validation in constructors, where we set up mandatory dependencies of the type.
The number one reason why we do this is to catch that error early and not get a null reference exception a few hours down the line without knowing where or when the faulty parameter was introduced. As we start transitioning to more and more TDD, some team members feel the validation is redundant.
Uncle Bob, who is a vocal advocate of TDD, strongly advices against doing parameter validation. His main argument seems to be "I have a suite of unit tests that makes sure everything works".
But I can for the life of it just not see in what way unit tests can prevent our developers from calling these methods with bad parameters in production code.
Please, unit testers out there, if you could explain this to me in a rational way with concrete examples, I'd be more than happy to seize this parameter validation!
I'm trying to run the unit tests from the gflags project, and I'd like
to know how to run them and what unit testing framework it is using to
do this.
I'm using Visual Studio 2005.
I'm sort of new to Perl and I'm wondering if there a prefered unit testing framework?
Google is showing me some nice results, but since I'm new to this, I don't know if there is a clear preference within the community.
It is easy given a container to get the associated iterators, example:
std::vector<double>::iterator i; //An iterator to a std::vector<double>
I was wondering if it is possible, given an iterator type, to deduce the type of the "corresponding container" (here I am assuming that for each container there is one and only one (non-const) iterator).
More precisely, I would like a template metafunction that works with all STL containers (without having to specialize it manually for each single container) such that, for example:
ContainerOf< std::vector<double>::iterator >::type
evaluates to
std::vector<double>
Is it possible?
If not, why?
Thank you in advance for any help!
My current project based in Asp .net makes considerable use of Http handlers to process various requests? So, is there any way by which I can test the functionality of each of the handlers using unit test cases? We are using Nunit and Moq framework to facilitate unit testing.
Trying to specify the assembly name like this:
Type.GetType(string.Format("{0}.{1}, {0}", widget.Assembly, widget.Class));
Throws this:
The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest
Trying it without the the assembly:
Type.GetType(string.Format("{0}.{1}", widget.Assembly, widget.Class));
Returns null.
I am looking for a way to instantiate a class using it's fully qualified name in Silverlight 4.0. Thanks.