Created
October 15, 2015 19:58
-
-
Save alan-andrade/8c91529a723e828065ee to your computer and use it in GitHub Desktop.
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
typedef NSUInteger LLWorkoutIndex; | |
typedef enum : LLWorkoutIndex { | |
LLFitTestExperience = 0, | |
LLBMIExperience = 1, | |
LLScriptedExperience = 7, | |
} LLWorkoutExperince; | |
@interface LLExperience : NSObject | |
+ (LLWorkoutIndex)indexForWorkoutExperience:(LLWorkoutExperince)experience; | |
@end | |
@implementation LLExperience | |
+ (LLWorkoutIndex)indexForWorkoutExperience:(LLWorkoutExperince)experience | |
{ | |
switch (experience) { | |
case LLFitTestExperience: | |
return (LLWorkoutIndex)0; | |
case LLBMIExperience: | |
return (LLWorkoutIndex)1; | |
case LLScriptedExperience: | |
return (LLWorkoutIndex)7; | |
} | |
} | |
@end | |
// OR | |
// Static dictionary ? Or just the enum ? | |
SpecBegin(LLTrainer) | |
describe(@"LLWorkoutExperience", ^{ | |
describe(@"indexForWorkoutExperience", ^{ | |
context(@"for FitTest", ^{ | |
it(@"should be 0", ^{ | |
LLWorkoutIndex index = [LLExperience indexForWorkoutExperience:LLFitTestExperience]; | |
expect(index).to.equal(0); | |
}); | |
}); | |
context(@"for Bmi", ^{ | |
it(@"should be 1", ^{ | |
}); | |
}); | |
context(@"for Scripted", ^{ | |
it(@"should be 7", ^{ | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment