graphics-tests.js revision a674c2c1af7be192fa94e4401511641f5a95ee47
ENGINE = "vml",
if(DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"))
{
ENGINE = "svg";
}
{
ENGINE = "canvas";
}
name: "GraphicsTests",
graphic: null,
mycircle: null,
myrect: null,
myellipse: null,
mypath: null,
initialFillColor: "#f00",
initialStrokeColor: "#00f",
updatedFillColor: "#9aa",
updatedStrokeColor: "#99a",
setUp: function () {
},
tearDown: function () {
},
"testGraphic()" : function()
{
Y.one("#testbed").setContent('<div style="position:absolute;top:0px;left:0px;width:500px;height:400px" id="graphiccontainer"></div>');
});
},
"testRectNode()" : function()
{
type: "rect",
width: 300,
height: 200,
fill: {
color: this.initialFillColor
},
stroke: {
color: this.initialStrokeColor
}
});
},
"testRectNodeDimensions()" : function()
{
},
"testRectNodeFillColor()" : function()
{
},
"testRectNodeFillOpacity()" : function()
{
},
"testRectNodeStrokeColor" : function()
{
},
"testRectNodeStrokeWidth" : function()
{
},
"testRectNodeStroke" : function()
{
},
"testRectNodeStrokeDashArray" : function()
{
},
"testRectNodeStrokeLineCap" : function()
{
},
"testRectNodeStrokeLineJoin" : function()
{
},
"testRectNodeWidthAgainstShapeAttr" : function()
{
},
"testRectNodeHeightAgainstShapeAttr" : function()
{
},
"testRectNodeFillAgainstShapeAttr" : function()
{
},
"testRectNodeStrokeAgainstShapeAttr" : function()
{
}
});
if(ENGINE == "svg")
{
}
name: "GraphicsTests",
graphic: null,
mycircle: null,
myrect: null,
myellipse: null,
mypath: null,
initialFillColor: "#f00",
initialStrokeColor: "#00f",
updatedFillColor: "#9aa",
updatedStrokeColor: "#99a",
setUp: function () {
},
tearDown: function () {
},
"test default construction": function () {
},
"test render()": function () {
Y.one("#testbed").setContent('<div style="position:absolute;top:0px;left:0px;width:500px;height:400px" id="graphiccontainer"></div>');
node,
});
},
"test addShape(circle)": function()
{
type: "circle",
stroke: {
color: this.initialStrokeColor,
weight: 1
},
fill: {
color: this.initialFillColor
},
radius: 12,
x: -5,
y: -5
});
},
"test mycircle.get(radius)": function()
{
},
"test mycircle.get(width)": function()
{
},
"test mycircle.get(height)" : function()
{
},
"test mycircle.get(stroke)" : function()
{
},
"test mycircle.get(fill)" : function()
{
},
"text mycircle.get(x)" : function()
{
},
"test mycircle.get(y)" : function()
{
},
"test mycircle.set(stroke)" : function()
{
color: this.updatedStrokeColor
});
},
"test mycircle.set(fill)" : function()
{
color: this.updatedFillColor
});
},
"testRemoveShape(circle)": function()
{
var id,
},
"test addShape(rect)": function()
{
type: "rect",
stroke: {
weight: 2,
color: this.initialStrokeColor
},
fill: {
color: this.initialFillColor
},
x: 5,
y: 5,
width:300,
height: 200
});
},
"test myrect.get(width)": function()
{
},
"test myrect.get(height)" : function()
{
},
"test myrect.get(stroke)" : function()
{
},
"test myrect.get(fill)" : function()
{
},
"test myrect.get(x)" : function()
{
},
"test myrect.get(y)" : function()
{
},
"test myrect.set(stroke)" : function()
{
color: this.updatedStrokeColor
});
},
"test myrect.set(fill)" : function()
{
color: this.updatedFillColor
});
},
"test removeShape(rect)" : function()
{
var id,
},
"test addShape(ellipse)": function()
{
type: "ellipse",
stroke: {
color: this.initialStrokeColor,
weight: 2
},
fill: {
color: this.initialFillColor
},
width: 100,
height: 30,
x:100,
y:50
});
},
"test myellipse.get(width)": function()
{
},
"test myellipse.get(height)" : function()
{
},
"test myellipse.get(stroke)" : function()
{
},
"test myellipse.get(fill)" : function()
{
},
"test myellipse.get(x)" : function()
{
},
"test myellipse.get(y)" : function()
{
},
"test myellipse.set(stroke)" : function()
{
color: this.updatedStrokeColor
});
},
"test myellipse.set(fill)" : function()
{
color: this.updatedFillColor
});
},
"test removeShape(ellipse)" : function()
{
var id,
},
"test addShape(path)": function()
{
type: "path",
stroke: {
color: this.initialStrokeColor
},
fill: {
color: this.initialFillColor
}
});
},
"test mypath.get(width)": function()
{
},
"test mypath.get(height)" : function()
{
},
"test mypath.get(stroke)" : function()
{
},
"test mypath.get(fill)" : function()
{
},
"test mypath.get(x)" : function()
{
},
"test mypath.get(y)" : function()
{
},
"test mypath.set(stroke)" : function()
{
color: this.updatedStrokeColor
});
},
"test mypath.set(fill)" : function()
{
color: this.updatedFillColor
});
},
"test removeShape(path)" : function()
{
var id,
},
"test passRotation(rect)" : function()
{
type: "rect",
stroke: {
weight: 2,
color: this.initialStrokeColor
},
fill: {
color: this.initialFillColor
},
x: 5,
y: 5,
width:300,
height: 200,
rotation: 45
});
}
}));