Actionscript 3 :: Write Unit Tests For Dictionary

Jan 20, 2012

This is kinda related to my other question: flex dictionary bug? The HashMap has a method getValues() which returns an array of values:

[cODE]....

the loop for (var key:* in map) iterates the keys of the dictionary map, but it seems its implementation does it in some random way. What is the best way to write a test since I don't know what the array returned by getValues method will contain? I thought I could do it by calling the sort method, and compare the values, is there a better way to do it?assertEquals(map.getValues().sort(), "value A,value B,value C,value X,value Y,value Z");

View 1 Replies


Similar Posts:


Flex :: Include Unit Tests In A Library?

Nov 24, 2009

I'm working on a general code library for ActionScript 3.0 called as3lib which includes several extensions to the core API and some useful functions. I've written several unit tests (using FlexUnit) to make sure everything is working correctly.

What is the best way to organize these tests in the library? Currently, I have all my code in src/ and my tests in test/ but I've set up a secondary Flex project to run the unit tests. I am also manually adding and removing the test files from the library when I want to run the tests.

Preferably one where the compiled library doesn't include the test files but I don't need two separate projects to test them.

View 4 Replies

Flex :: Flash Builder: Change Default Suite For Unit Tests?

Dec 7, 2010

What are the steps to change your default suite when running unit tests in Flash Builder 4 with PureMVC?

View 2 Replies

Flex :: Continuous Integration - Run Unit Tests From The Command Line On Linux?

Mar 12, 2011

I am setting up a FlexBuilder build under Hudson/Jenkins on a Linux system. I want to execute our unit tests, but do it without using the standard GUI-based test runner.

View 1 Replies

Actionscript 3 :: Dictionary Mechanism - Dictionary Use Id To Compare If The Two Keys Are Equal, Not Use Strict Equal(===) To Compare If The Key Is The Same?

Aug 27, 2010

The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:

class Student{
var id:int;
var name:String;[code]....

I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.

View 2 Replies

MX Hit Tests Won't Always Work?

Dec 28, 2009

Macromedia Flash MX 2004 I posted this somewhere else - but then realized no one actually uses that forum except to post ads...

Quote:
onClipEvent(enterFrame){
if(this.hitTest(_root.blaze))
_root.floor.speed = -20;
else{

[Code]...

I won't post the file because I'm using someone else's character and it's fine with them, but I doubt it should be here - this is the only code that's a problem, though.

View 12 Replies

Setting Up Functional Tests In Flex?

Apr 23, 2010

I'm setting up a functional test suite for an application that loads an external configuration file. Right now, I'm using flexunit's addAsync function to load it and then again to test if the contents point to services that exist and can be accessed.

The trouble with this is that having this kind of two (or more) stage method means that I'm running all of my tests in the context of one test with dozens of asserts, which seems like a kind of degenerate way to use the framework, and makes bugs harder to find. Is there a way to have something like an asynchronous setup? Is there another testing framework that handles this better?

View 3 Replies

Organizing FlexUnit 4 Tests In FlexBuilder 3?

Jan 24, 2011

I've recently started practising test driven development - thus far I've been working on a library project, so I've organised my FlexUnit tests in a separate FlexBuilder 3 project, linking against my library's swc.Now I'm working on a web app and wondering how best to organise the tests for this. At the moment I've put them in a src/test package in the project I'm testing, with the test runner application at the same level as the default application. Is this the best way to do it, or should I have a separate test project and link in the source for the application I'm testing?

View 1 Replies

Actionscript :: Programming Tests For Flash Developers?

Feb 19, 2010

What programming tests do company's give Flash developers?

I would like to level the playing field for developers and recruiters.

I've heard companies give debugging tests with broken documents you have to fix. Flash developers could include Flash IDE users and actionscript programmers.

Everyone would like to know what to expect and understand some of the blind spots we face. A rundown on "what to be prepared for" may be a right answer. Best anecdote or inside scoop on major companies is good too (don't have to use real names, it's up to you). Perhaps you have an opinion of what is fair or reasonable, I'd like to know.

View 6 Replies

Flex :: Writing Integration Tests For App Using SqLite?

Jun 28, 2010

I want to write integration tests for a Flex application using pureMVC architecture.The back-end is sqlite.

View 1 Replies

Actionscript :: Creating A Function That Tests If An Array Contains Something?

Jun 19, 2011

openList = Array([1,1], [2,3], [4,5]);
containss = function (input, arrayData, tellID) {
for (i = 0; i < arrayData.length; i++) {
if (arrayData[i] == input) {

[code]....

This code returns false when openList contains 2,3. When I add trace(arrayData[i]), I get 1,1 2,3 4,5 and when I do trace(input) I get 2,3.

View 1 Replies

ActionScript 3.0 :: Boolean Tests Combination Of Values

Nov 12, 2011

The objective is when user clicks on any combination of 2 buttons you would then gotoAndPlay a new page based onthe two specific buttons you have selected? Ideally user would be able to intermix the button combinations. Code below only works for two specific buttons, but doesn't allow to intermix button clicks.

[Code]...

View 5 Replies

ActionScript 3.0 :: Positioning Works In Tests But Not In Browser?

Oct 25, 2010

I wrote an app that uses the stage.stageWidth and stage.stageHeight to position various elements. It works beautifully when I run the swf in the standalone player, but when I upload it to a site and view it in the browser the positioning is all wrong!

View 2 Replies

ActionScript 3.0 :: Boolean That Tests Combination Of Values?

Nov 11, 2011

The objective is when user clicks on any combination of 2 buttons you would then gotoAndPlay a new page based onthe two specific buttons you have selected? Ideally user would be able to intermix the button combinations.

I've attached a simple diagram that visually explains objective of actionscript.

Code below only works for two specific buttons, but doesn't allow to intermix button clicks.

[Code]...

View 4 Replies

Add 1 Unit Every 0.83 Seconds?

Apr 20, 2010

I need to do a heartbeat counter. This is a simple counter that should add 1 unit every 0.83 seconds.Its a simple web page with a 10 digit number counting the heartbeat of aparticular person (50 years old).

View 4 Replies

Actionscript :: Read XML And Write On List Write?

Oct 25, 2011

I'm trying to read a XML file and output the values, but i'm getting a 1120: Access of undefined property URLRequest. error.

[Code]...

View 2 Replies

Reset Database To Known State Between FlexUnit4 Integration Tests?

Oct 24, 2010

I have a Flex web app that communicates with a Java back-end via BlazeDS. The Flex client is composed of a flex-client module, which holds the views and presentation models and a separate flex-service module which holds the models (value objects) and service objects.

I am in the process of writing asynchronous integration tests for the flex-service module's RemoteObjects using FlexUnit4. In some of the tests, I modify the test data and query it back to see if everything works (a technique shown here: [url]...

How do I go about resetting the database to a known state before each FlexUnit4 test method (or test method chain)? In my Java server integration tests, I did this via a combination of DBUnit and Spring Test's transactions -- which rollback after each test method. But these Flexunit integration span multiple requests and thus multiple transactions.

View 3 Replies

Flex :: Configure Eclipse To Run FlexUnit Tests Automatically?

Jun 8, 2009

I'd like to set up my projects in Eclipse to run FlexUnit tests everytime I save my work.

I found an example with JUnit here : [URL]

How would you do it? Is it possible to run FlexUnit tests without Flash Player?

View 3 Replies

IDE :: Unit Is XML Motion Measured In?

Sep 19, 2009

I output a motion to an XML file using the Export Motion XML command. Then I applied it to a new graphic, and it came out wrong. After 323 frames of motion, the graphic is now at the wrong position, about 15 pixels to the left of where it should be.

When creating the animation, I had "snap to pixels" turned on, so every position of the source graphic is at a round number. When I look at the values in the generated XML file, it's full of sequences like this:

[Code]...

View 1 Replies

Flash :: Selenium (or Other Record / Playback Tool For Authoring Tests)?

Nov 1, 2010

is there something like Selenium for Flash? Or any other record/playback tool for authoring tests for Flash?

View 3 Replies

ActionScript 3.0 :: Getting Good Collisions Between Balls And Also Using Hit Tests To Trigger Sound

Apr 29, 2010

im building a sound toy that has four balls that can be thrown around and will bounce of each other. when each ball collides i have a chord to be played through a hit test for each pair. im having a problem with getting good collisions between balls and also using hit tests to trigger sound.

View 1 Replies

ActionScript 3.0 :: Collision - Sweep Tests For Fast Moving Objects

Feb 7, 2010

has anyone found an AS3 source/Maths-lib etc that covers not just simple collision tests but swept collision tests (at least swept AABB/circle tests) for fast moving objects? I had a quick look at flixel but even that does not seem to have sweep tests for fast moving objects.

View 2 Replies

ActionScript 3.0 :: Making Hit Tests Work With Multiple Instances Of A Movieclip?

May 18, 2011

I seem to have a bit of a problem with getting the collision detection working in harmony with the rest of my code. Basically i have an array that creates multiple instances of a movieclip named mcPlatformStandard with the following piece of code...

Code:
//this variable holds all of the platforms
var platformHolder:MovieClip = new MovieClip();
//adds the platform to stage

[Code]....

View 1 Replies

ActionScript 3.0 :: Comparing Unit Or Int To Number?

Mar 21, 2011

Is it bad to compare a unit or int to a number? Should they always be kept apart?
PHP Code:
var i:int=10;var n:Number=20;if(n>i){}

View 1 Replies

ActionScript 2.0 :: Textarea Tests Fine But When Uploaded It Doesn't Load .txt File

Nov 16, 2005

i've created two textarea fields that pull data from a textfile in the same directory and formats it with CSS. it tests fine on my computer, but when i upload it, it doesn't show the txt file contents. It's just blank. I've been looking around everywhere to try and find a solution, but i can't seem to find anything. Also, the scrollbar on the side of the textarea doesn't load in IE but loads in firefox.

[Code]....

View 8 Replies

ActionScript 1/2 :: Unit Moves Smoothly To The Destination?

Jun 10, 2011

I got this code and i whant to make it so unit moves smoothly to the destination i got told to seach key words like LiteTween and built in tween
 
unit.onRelease = function(){ _root.onMouseUp = function(){ unit._x = _xmouse; unit._y = _ymouse; delete _root.onMouseUp; }}

View 7 Replies

ActionScript 1/2 :: Add Unit Function - Array Class?

Aug 5, 2011

Is there a way to add the unit what gets attached to the array as unit4 and has an instance of unit4 and then if u press it again as unit5 with instance of unit5 and so on. This is my array.

var unitA:Array=[unit,unit1,unit2];
var unit = 0;
function addunit() {
if (cash>=50) {
var unit = attachMovie("unit", "unit"+units, _level0.getNextHighestDepth(), {_x:100, _y:100});
unit += 1;
cash -= 140;
}} unit_btn.onRelease = addunit;

View 7 Replies

Flex :: Unit Testing Event Handlers

Jul 24, 2009

What methods do you use to unit test event handlers, particularly if they require information from the event (such as mouse coordinates, or the target of the event)? Is the most common practice to just refactor the behavior into a method that does the lifting while the handler just extracts information from the event, or are there effective ways to simulate event dispatch in FlexUnit or Fluint?

View 1 Replies

Flexunit - Unit Test Flex Applications?

Jul 26, 2010

Flex is a client-side language and based on events. How can such events be mocked to allow unit testing?

View 2 Replies

Flash :: Unit Testing Frameworks Or Libraries?

Feb 5, 2011

What are the best unit testing frameworks or libraries for AS3 programming? Specifically for projects that do not involve Flex, only Flash.

View 1 Replies







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