This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('MatrizEspiral', function () { | |
it ('Deve retornar uma matriz espiral que incrementa no sentido horário', function () { | |
var response = [] | |
response[0] = [ 1, 2, 3]; | |
response[1] = [10, 11, 4]; | |
response[2] = [ 9, 12, 5]; | |
response[3] = [ 8, 7, 6]; | |
expect(MatrizEspiral(3, 4)).toEqual(response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('PrimeFactor', function () { | |
it ('Deve retornar um array com a decomposicao em fatores primos', function () { | |
expect(primeFactor(100)).toEqual([2, 2, 5, 5]); | |
expect(primeFactor(2)).toEqual([2]); | |
expect(primeFactor(12)).toEqual([2, 2, 3]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Quando a página tiver sido carregada... | |
window.onload = function () { | |
//atribuímos um evento de click ao botão. | |
//Ao clicar, chamamos a função 'change' | |
$('#changeClass').on('click', function () { | |
change(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Quando a página tiver sido carregada... | |
window.onload = function () { | |
//atribuímos um evento de click ao botão. | |
//Ao clicar, chamamos a função 'change' | |
$('#changeClass').on('click', function () { | |
change(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var start = new Date().getTime(); | |
var div = $('#content')[0]; | |
for (var i = 0; i < 1000000; i++) { | |
if (i % 2 === 1) { | |
div.className = ''; | |
} else { | |
div.className = 'display-none'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var start = new Date().getTime(); | |
var div = $('#content'); | |
var divStyle = div[0].style; | |
for (var i = 0; i < 1000000; i++) { | |
if (i % 2 === 1) { | |
divStyle.display = 'block'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var start = new Date().getTime(); | |
var div = $('#content'); | |
for (var i = 0; i < 1000000; i++) { | |
if (i % 2 === 1) { | |
div.removeClass('display-none'); | |
} else { | |
div.addClass('display-none'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var start = new Date().getTime(); | |
var div = $('#content'); | |
for (var i = 0; i < 1000000; i++) { | |
if (i % 2 === 1) { | |
div.css('display', 'block'); | |
} else { | |
div.css('display', 'none'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Teste usando .css</title> | |
<style type="text/css"> | |
#content { | |
width: 100px; | |
height: 100px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('ProgressionValidator', function () { | |
it ('Deve retornar um array ["pa"] quando tratar-se de uma progressao aritmetica', function () { | |
expect(ProgressionValidator([1, 3, 5])).toEqual(['pa']); | |
expect(ProgressionValidator([10, 8, 6])).toEqual(['pa']); | |
expect(ProgressionValidator([-3, -7, -11])).toEqual(['pa']); | |
}); |