Search Results

Search found 24915 results on 997 pages for 'ordered test'.

Page 64/997 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • How To Test if a Type is Anonymous?

    - by DaveDev
    Hi Guys I have the following method which serialises an object to a HTML tag. I only want to do this though if the type isn't Anonymous. private void MergeTypeDataToTag(object typeData) { if (typeData != null) { Type elementType = typeData.GetType(); if (/* elementType != AnonymousType */) { _tag.Attributes.Add("class", elementType.Name); } // do some more stuff } } Can somebody show me how to achieve this? Thanks Dave

    Read the article

  • Trying to test space in filesystem on Unix

    - by Buzkie
    I need to check if I Filesystem exists, and if it does exist there is 300 MB of space in it. What I have so far: if [ "$(df -m /opt/IBM | grep -vE '^Filesystem' | awk '{print ($3)}')" < "300" ] then echo "not enough space in the target filesystem" exit 1 fi This throws an error. I don't really know what I'm doing in shell. My highest priority is AIX but I'm trying to get it to work for HP and Sun too. Please help. -Alex

    Read the article

  • How can I test potentially browser crashing javascript

    - by yaya3
    I've been having a crack at some of the problems over at http://projecteuler.net/ with JavaScript. I've been using a simple html page and running my code in script tags so I can log my results in the browsers' console. When experimenting with loops I sometimes cause the browser to crash. Is there a better environment for me to do this kind of development?

    Read the article

  • How to test css property in rspec?

    - by Senthil
    I'm using tabnav plugin for Rails and I want to use rpsec to make sure it highlights properly. describe 'account navigation links' do it 'should have account settings link' do get '/account/settings' response.should have_tag("li", :text => "Account Settings") end it 'should be highlighted' do get '/account/settings' response.should have_tag("li", :color => "Account Settings") end end However the above code doesn't seem to work. I'm using webrat with rspec btw. Any help? Thanks.

    Read the article

  • Trying to test for OS and space in filesystem on AIX

    - by Buzkie
    I need to check if I Filesystem exists, and if it does exist there is 300 MB of space in it. What I have so far: if [ "$(df -m /opt/IBM | grep -vE '^Filesystem' | awk '{print ($3)}')" < "300" ] then echo "not enough space in the target filesystem" exit 1 fi This throws an error. I don't really know what I'm doing in shell. Please help. -Alex

    Read the article

  • Why is this basic equality test failing?

    - by Goose Bumper
    I have a pointer m to an object, and calling m->det() returns 14 (the return type is a double). Why would the following statement evaluate to false? cout << (m->det()==14) << endl; I just don't understand how this could be failing. Using cout << m->det() << endl; cout << (m->det()==14) << endl; gives me: 14 0

    Read the article

  • Perform manual test, automate after - or never?

    - by dotnetdev
    In my current company, we have one tester. Having spoken to this tester, she says that in testing, before implementing any automation systems, the scripts (steps to take) are manually written and performed (performed at least once). Is this the way things work in testing? To make me laugh, this has been done in this case, yet no automation. It makes me laugh to see the lead tester perform loads of different combinations of usernames and passwords for a login form (which she is not overly keen on having automated) when I could easily automate that (but politics in the company won't allow that). This doesn't seem like the environment where a junior tester (not me, I'm a SDET) cannot learn anything. Thanks

    Read the article

  • Difficulty to start up with basic unit test (Sample from my book -- SportsStore)

    - by Richard77
    Hello, I'm really new in TDD and, actually, I'm trying to follow the sample from my book (SportsStore -- Pro ASP.NET MVC Framework/Steve Sanderson/APRESS). I'm on pages 103-105. Although there are more on this, as new to all of this, I'm concerned with the following statements. ProductsController controller = new ProductsController(repository); var result = controller.List(2); //... regarding the above statements, when I write this (as in the book), var products = result.ViewData.Model as IList<Product>; I get a compiler error "System.Web.MVC.ActionResult" does not contain a definition for ViewData ..." But, when I remove the List() from the statement, then the compiler error disapear. var result = controller.List(2);//Doesn't work var result = controller;//It works Is something wrong there? I checked Apress website for that book, but there is nothing listed as Errata or issue. So I'm really lost. Thanks for helping

    Read the article

  • Configuring an offscreen framebuffer fails the completeness test

    - by randallmeadows
    I'm trying to create an offscreen framebuffer into which I can do some OpenGL drawing, and then pull the bits out manually. I'm following the instructions here, but in step 4, status is 0 instead of GL_FRAMEBUFFER_COMPLETE_OES. If I insert a call go glGetError() after every gl call, it returns 0 (GL_NO_ERROR) every time. But, the values of variables do not change during the call. E.g., GLuint framebuffer; glGenFramebuffersOES(1, &framebuffer); glBindFramebufferOES(GL_FRAMEBUFFER_OES, framebuffer); the value of framebuffer does not get altered at all (even when I change it to some arbitrary value and re-execute). It's almost like the gl calls are not actually being made. I'm linking against OpenGLES framework, and get no compile, link, or run-time errors (or warnings). I'm at a loss as to what to do to fix this. I've tried continuing on with my drawing, but do not see the results I expect, but at this point I can't tell whether it's because of the above error, or the conversion to a UIImage.

    Read the article

  • How to assert/unit-test servers JSON response?

    - by shazax
    My current project uses JSON as data interchange format. Both Front-end and Back-end team agree upon a JSON structure before start integrating a service. At times due to un-notified changes in JSON structure by back-end team; it breaks the front-end code. Is there any external library that we could use to compare a mock JSON (fixture) with servers JSON response. Basically it should assert the whole JSON object and should throw an error if there is any violation in servers JSON format. Additional info: App is built on JQuery consuming REST JSON services.

    Read the article

  • How to test crontab entry?

    - by Mark
    I have an entry in my crontab that looks like this: 0 3 * * * pg_dump mydb | gzip > ~/backup/db/$(date +%Y-%m-%d).psql.gz That script works perfectly when I execute it from the shell, but it doesn't seem to be running every night. I'm assuming there's something wrong with the permissions, maybe crontab is running under a different user or something. How can I debug this? I'm a shared hosting environment (WebFaction).

    Read the article

  • Dreamweaver creating temp php files instead of working direct from the local test server files

    - by Dan382
    Trying to get MAMP running with Dreamweaver. When I preview a php file inside Dreamweavers 'Live View' mode instead of working direct from my file: http://localhost/php_test/timetest.php it creates its own temp file which looks like: http:// 127.0.0.1/php_test/ TMPWY5ZEM.php (I've added the additional spaces as stockoverflow assumed I was spamming) I know the localhost runs correctly as if I type the URL directly into a browser it runs fine. I've set up the Dreamweaver site correctly to the best of my knowledge, the details are below: Local site folder: /Applications/MAMP/htdocs/php_test Server Folder: /Applications/MAMP/htdocs/php_test Web URL: http://localhost/php_test/ Testing Server: PHP MySQL Any help?

    Read the article

  • are fixtures loaded when using the sql dump to create a test database

    - by Josh Moore
    Because of some non standard table creation options I am forced to use the sql dump instead of the standard schema.rb (i.e. I have uncommented this line in the environment.rb config.active_record.schema_format = :sql). I have noticed that when I use the sql dump that my fixtures do not seem to be loaded into the database. Some data is loaded into it but, I am not sure where it is coming from. Is this normal? and if it is normal can anybody tell me where this other data is coming from?

    Read the article

  • Problem at JUnit test with generics

    - by Tom Brito
    In my utility method: public static <T> T getField(Object obj, Class c, String fieldName) { try { Field field = c.getDeclaredField(fieldName); field.setAccessible(true); return (T) field.get(obj); } catch (Exception e) { e.printStackTrace(); fail(); return null; } } The line return (T) field.get(obj); gives the warning "Type safety: Unchecked cast from Object to T"; but I cannot perform instanceof check against type parameter T, so what am I suppose to do here?

    Read the article

  • how do i implement / build / create an 'in memory database' for my unit test

    - by Michel
    Hi all, i've started unit testing a while ago and as turned out i did more regression testing than unit testing because i also included my database layer thus going to the database verytime. So, implemented Unity to inject a fake database layer, but i of course want to store some data, and the main opinion was: "create an in-memory database" But what is that / how do i implement that? Main question is: i think i have to fake the database layer, but doesn't that make me create a 'simple database' myself or: how can i keep it simple and not rebuilding Sql Server just for my unit tests :) At the end of this question i'll give an explanation of the situation i got in on the project i just started on, and i was wondering if this was the way to go. Michel Current situation i've seen at this client is that testdata is contained in XML files, and there is a 'fake' database layer that connects all the xml files together. For the real database we're using the entity framework, and this works very simple. And now, in the 'fake' layer, i have top create all kind of classes to load, save, persist etc. the data. It sounds weird that there is so much work in the fake layer, and so little in the real layer. I hope this all makes sense :)

    Read the article

  • Downloadable HTML Test Corpus

    - by Alex Jordan
    I am working on a browser plug-in for Firefox, and I would like to be able to do some automated testing to make sure that it's handling a variety of different HTML/JavaScript features correctly. Does anyone know of a good downloadable corpus of HTML and/or JavaScript pages that could be used for this type of testing?

    Read the article

  • dynamic, How to test if a property is available

    - by Miau
    Scenario is very simple somewhere in the code I have this dynamic myVariable = GetDataThatLooksVerySimilarButNotTheSame(); //how to do this? if (myVariable.MyProperty.Exists) //Do stuff So basically the question is how to check (avoiding exceptions) that a certain property is available in my dynamic variable. I could do GetType() but I d rather avoid that, I dont actually want to know the type of the object I want to know if a property (or method if that makes life easier) is available Any pointers? Cheers

    Read the article

  • Django Fancy String Diff During Test Execution in Console

    - by Koobz
    Anyone know of any pre-existing tools out there what will highlight differences in output when running Django tests? I'm comparing some JSON output and it's tough to find things like extra spaces. I was about to just copy and paste this into an existing diff tool but I figured this might be on someone's radar.

    Read the article

  • C# Visual Studio Unit Test, Mocking up a client IP address

    - by Jimmy
    Hey guys, I am writing some unit tests and I'm getting an exception thrown from my real code when trying to do the following: string IPaddress = HttpContext.Current.Request.UserHostName.ToString(); Is there a way to mock up an IP address without rewriting my code to accept IP address as a parameter? Thanks!

    Read the article

  • RhinoMocks: how to test if method was called when using PartialMock

    - by epitka
    I have a clas that is something like this public class MyClass { public virtual string MethodA(Command cmd) { //some code here} public void MethodB(SomeType obj) { // do some work MethodA(command); } } I mocked MyClass as PartialMock (mocks.PartialMock<MyClass>) and I setup expectation for MethodA var cmd = new Command(); //set the cmd to expected state Expect.Call(MyClass.MethodA(cmd)).Repeat.Once(); Problem is that MethodB calls actual implementation of MethodA instead of mocking it up. I must be doing something wrong (not very experienced with RhinoMocks). How do I force it to mock MetdhodA? Here is the actual code: var cmd = new SetBaseProductCoInsuranceCommand(); cmd.BaseProduct = planBaseProduct; var insuredType = mocks.DynamicMock<InsuredType>(); Expect.Call(insuredType.Code).Return(InsuredTypeCode.AllInsureds); cmd.Values.Add(new SetBaseProductCoInsuranceCommand.CoInsuranceValues() { CoInsurancePercent = 0, InsuredType = insuredType, PolicySupplierType = ppProvider }); Expect.Call(() => service.SetCoInsurancePercentages(cmd)).Repeat.Once(); mocks.ReplayAll(); //act service.DefaultCoInsurancesFor(planBaseProduct); //assert service.AssertWasCalled(x => x.SetCoInsurancePercentages(cmd),x=>x.Repeat.Once());

    Read the article

  • C# Test if an object is an Enum

    - by Aran Mulholland
    I would like to know if 'theObject' is an enum (of any enum type) foreach (var item in Enum.GetValues(theObject.GetType())) { //make sure we have all the enumeration values in the collection if (this.ValuesCollection.Contains(item)) { } else { this.ValuesCollection.Add(item); } Console.WriteLine(item.ToString()); Console.WriteLine(item.GetType().ToString()); }

    Read the article

  • Jasmine DOM test using jasmine jquery with require module

    - by Purushoth
    I am using custom variant of jasmine 2.0 from here https://github.com/erikringsmuth/jasmine2-amd-specrunner. So that testing my require.js based application made possible. Here i have facing problem with using jasmine-jquery. The jasmine object is undefined. $ and window is fine. function (window, jasmine, $) I have reference added jasmine and jquery lib too <script type="text/javascript" src="lib/jasmine.js"></script> <script type="text/javascript" src="lib/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="lib/helpers/jasmine-jquery.js"></script>

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >