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
- (void)setUp { | |
[super setUp]; | |
controller = [[ViewController alloc] init]; | |
// Set-up code here. | |
} |
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
- (void)tearDown { | |
// Tear-down code here. | |
[super tearDown]; | |
controller = nil; | |
} |
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
- (void)testThatThirtyTwoFarenheitEqualsZeroCelsius { | |
double celsiusResult = [controller convertFarenheithToCelsius:32]; | |
double farenheitResult = [controller convertCelsiusToFarenheit:0]; | |
STAssertEquals(celsiusResult, 0, @"should be zero"); | |
STAssertEquals(farenheitResult, 32, @"should equal 32"); | |
} |
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
- (void)testThatConvertingBackAndForthDoesntAffectResults { | |
double celsius = 50; | |
double farenheitResult = [controller convertCelsiusToFarenheit:celsius]; | |
//convert back | |
double celsiusResult = [controller convertFarenheithToCelsius:farenheitResult]; | |
STAssertEquals(celsius, celsiusResult, @"should be equal"); | |
} |
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
SPEC_BEGIN(TemperatureConverterTests) | |
describe(@"basic converter", ^{ | |
it(@"converts farenheit To celsius", ^{ | |
ViewController *controller = [ViewController alloc]init]; | |
[[theValue([controller convertCelisusToFarenheit:-40]) should]equal:theValue(-40)]; | |
}); | |
it(@"converts celsius to farenheight", ^{ | |
ViewController *controller = [ViewController alloc]init]; | |
[[theValue([controller convertfarenheitToCelsius:-40]) should]equal:theValue(-40)]; |
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
- (double)convertFarenheitToCelsius:(double)farenheit { | |
double celsius = 0; | |
celsius = (5/9) * (farenheit - 32); | |
return celsius; | |
} |
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
- (double)convertCelsiusToFarenheit:(double)celsius { | |
double farenheit = 0; | |
farenheit = celsius * (9/5) + 32; | |
return farenheit; | |
} |
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
- (void)testThatHundredCelsiusIsTwoTwelveFarenheit { | |
double farenheitResult = [controller convertCelsiusToFarenheit:100]; | |
double celsiusResult = [controller convertFarenheithToCelsius:212]; | |
STAssertEquals(farenheitResult, 212, @"should equal 212"); | |
STAssertEquals(celsiusResult, 100, @"should equal 100"); | |
} |
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
- (void)testCelsiusEqualsFarenheitAtNegativeForty { | |
double celsiusResult = 0; | |
double farenheitResult = 0; | |
celsiusResult = [controller convertFarenheithToCelsius:-40]; | |
farenheitResult = [controller convertCelsiusToFarenheit:-40]; | |
STAssertEquals(celsiusResult, farenheitResult, @"these should be the same"); | |
} |
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
# Fullscreen | |
bind f:alt;cmd;ctrl move 0;0 screenSizeX;screenSizeY | |
# Half Screen | |
bind right:ctrl;cmd push right bar-resize:screenSizeX/2 | |
bind left:ctrl;cmd push left bar-resize:screenSizeX/2 | |
bind up:ctrl;cmd push up bar-resize:screenSizeY/2 | |
bind down:ctrl;cmd push down bar-resize:screenSizeY/2 | |
# Quarter Screen |