Skip to content
This repository
Browse code

merging for #70

  • Loading branch information...
commit a8aefb5a7c761553e1c16b44d2dec4d082d8b822 2 parents 1dd83d2 + 42cbe6a
Mark Yoon authored
69 NUSurveyor.xcodeproj/project.pbxproj
@@ -7,7 +7,14 @@
7 7 objects = {
8 8
9 9 /* Begin PBXBuildFile section */
  10 + 005AA64B1521F04B00E67C10 /* NUResponseSetTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 006CE3B815214DB400DD32A2 /* NUResponseSetTest.m */; };
  11 + 005AA64C1521F04B00E67C10 /* NUResponseTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 005AA6491521676300E67C10 /* NUResponseTest.m */; };
  12 + 005AA64F152208DE00E67C10 /* NUResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 005AA64D152208DE00E67C10 /* NUResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
  13 + 005AA650152208DE00E67C10 /* NUResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 005AA64E152208DE00E67C10 /* NUResponse.m */; };
10 14 0083A90C14F746F5005C1D94 /* NUConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 0083A90B14F746F5005C1D94 /* NUConstants.h */; };
  15 + 008AE62715224CE000F4F14C /* NUDatabaseTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 008AE62615224CE000F4F14C /* NUDatabaseTest.m */; };
  16 + 00C8457F152263DF003B9213 /* NSDateFormatter+Additions.h in Headers */ = {isa = PBXBuildFile; fileRef = 00C8457D152263DF003B9213 /* NSDateFormatter+Additions.h */; settings = {ATTRIBUTES = (Public, ); }; };
  17 + 00C84580152263DF003B9213 /* NSDateFormatter+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C8457E152263DF003B9213 /* NSDateFormatter+Additions.m */; };
11 18 3B24DED514EEEA8400E7D04C /* basic_survey.feature in Resources */ = {isa = PBXBuildFile; fileRef = 3B24DED414EEEA8400E7D04C /* basic_survey.feature */; };
12 19 3B24DED714EEEABF00E7D04C /* response_set_steps.rb in Resources */ = {isa = PBXBuildFile; fileRef = 3B24DED614EEEABF00E7D04C /* response_set_steps.rb */; };
13 20 3B2AB06E1522429E00525F25 /* NUOneStringOrNumberCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B2AB06C1522429E00525F25 /* NUOneStringOrNumberCell.h */; };
@@ -17,7 +24,6 @@
17 24 3B8CF201151B91C600EA4148 /* test-birth-date-survey.json in Resources */ = {isa = PBXBuildFile; fileRef = 3B8CF200151B91C600EA4148 /* test-birth-date-survey.json */; };
18 25 3BA2E94A14CDCD0F0057D05C /* NUSurvey.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BA2E94814CDCD0F0057D05C /* NUSurvey.h */; };
19 26 3BA2E94B14CDCD0F0057D05C /* NUSurvey.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BA2E94914CDCD0F0057D05C /* NUSurvey.m */; };
20   - 3BA2E94C14CDCD0F0057D05C /* NUSurvey.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BA2E94914CDCD0F0057D05C /* NUSurvey.m */; };
21 27 3BC61A7E1520CBDB00A8C20C /* NUAnyStringOrNumberCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BC61A7C1520CBDB00A8C20C /* NUAnyStringOrNumberCell.h */; };
22 28 3BC61A7F1520CBDB00A8C20C /* NUAnyStringOrNumberCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BC61A7D1520CBDB00A8C20C /* NUAnyStringOrNumberCell.m */; };
23 29 3BC61A841520F75000A8C20C /* NUAnyDatePickerCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BC61A821520F74F00A8C20C /* NUAnyDatePickerCell.h */; };
@@ -37,53 +43,38 @@
37 43 3BD52AC214C8B43500AB61E8 /* NUSurveyorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AC114C8B43500AB61E8 /* NUSurveyorTests.m */; };
38 44 3BD52AD014C8B5A200AB61E8 /* NUSurveyTVC.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52ACE14C8B5A200AB61E8 /* NUSurveyTVC.h */; settings = {ATTRIBUTES = (Public, ); }; };
39 45 3BD52AD114C8B5A200AB61E8 /* NUSurveyTVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52ACF14C8B5A200AB61E8 /* NUSurveyTVC.m */; };
40   - 3BD52AD214C8B5A200AB61E8 /* NUSurveyTVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52ACF14C8B5A200AB61E8 /* NUSurveyTVC.m */; };
41 46 3BD52AD514C8B5B600AB61E8 /* NUSectionTVC.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52AD314C8B5B600AB61E8 /* NUSectionTVC.h */; settings = {ATTRIBUTES = (Public, ); }; };
42 47 3BD52AD614C8B5B600AB61E8 /* NUSectionTVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AD414C8B5B600AB61E8 /* NUSectionTVC.m */; };
43   - 3BD52AD714C8B5B600AB61E8 /* NUSectionTVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AD414C8B5B600AB61E8 /* NUSectionTVC.m */; };
44 48 3BD52ADA14C8B5FE00AB61E8 /* UUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52AD814C8B5FE00AB61E8 /* UUID.h */; settings = {ATTRIBUTES = (Public, ); }; };
45 49 3BD52ADB14C8B5FE00AB61E8 /* UUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AD914C8B5FE00AB61E8 /* UUID.m */; };
46   - 3BD52ADC14C8B5FE00AB61E8 /* UUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AD914C8B5FE00AB61E8 /* UUID.m */; };
47 50 3BD52ADF14C8B62600AB61E8 /* NUPickerVC.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52ADD14C8B62600AB61E8 /* NUPickerVC.h */; settings = {ATTRIBUTES = (Public, ); }; };
48 51 3BD52AE014C8B62600AB61E8 /* NUPickerVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52ADE14C8B62600AB61E8 /* NUPickerVC.m */; };
49   - 3BD52AE114C8B62600AB61E8 /* NUPickerVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52ADE14C8B62600AB61E8 /* NUPickerVC.m */; };
50 52 3BD52AE414C8B65400AB61E8 /* NUResponseSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52AE214C8B65400AB61E8 /* NUResponseSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
51 53 3BD52AE514C8B65400AB61E8 /* NUResponseSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AE314C8B65400AB61E8 /* NUResponseSet.m */; };
52   - 3BD52AE614C8B65400AB61E8 /* NUResponseSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AE314C8B65400AB61E8 /* NUResponseSet.m */; };
53 54 3BD52AE914C8B6A400AB61E8 /* NUAnyCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52AE714C8B6A400AB61E8 /* NUAnyCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
54 55 3BD52AEA14C8B6A400AB61E8 /* NUAnyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AE814C8B6A400AB61E8 /* NUAnyCell.m */; };
55   - 3BD52AEB14C8B6A400AB61E8 /* NUAnyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AE814C8B6A400AB61E8 /* NUAnyCell.m */; };
56 56 3BD52AEE14C8B6B900AB61E8 /* NUDatePickerCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52AEC14C8B6B900AB61E8 /* NUDatePickerCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
57 57 3BD52AEF14C8B6B900AB61E8 /* NUDatePickerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AED14C8B6B900AB61E8 /* NUDatePickerCell.m */; };
58   - 3BD52AF014C8B6B900AB61E8 /* NUDatePickerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AED14C8B6B900AB61E8 /* NUDatePickerCell.m */; };
59 58 3BD52AFD14C8B6E900AB61E8 /* NUNoneCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52AFB14C8B6E800AB61E8 /* NUNoneCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
60 59 3BD52AFE14C8B6E900AB61E8 /* NUNoneCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AFC14C8B6E800AB61E8 /* NUNoneCell.m */; };
61   - 3BD52AFF14C8B6E900AB61E8 /* NUNoneCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52AFC14C8B6E800AB61E8 /* NUNoneCell.m */; };
62 60 3BD52B0214C8B6F700AB61E8 /* NUNoneTextCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52B0014C8B6F600AB61E8 /* NUNoneTextCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
63 61 3BD52B0314C8B6F700AB61E8 /* NUNoneTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B0114C8B6F600AB61E8 /* NUNoneTextCell.m */; };
64   - 3BD52B0414C8B6F700AB61E8 /* NUNoneTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B0114C8B6F600AB61E8 /* NUNoneTextCell.m */; };
65 62 3BD52B0714C8B70500AB61E8 /* NUOneCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52B0514C8B70500AB61E8 /* NUOneCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
66 63 3BD52B0814C8B70500AB61E8 /* NUOneCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B0614C8B70500AB61E8 /* NUOneCell.m */; };
67   - 3BD52B0914C8B70500AB61E8 /* NUOneCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B0614C8B70500AB61E8 /* NUOneCell.m */; };
68 64 3BD52B1114C8B74800AB61E8 /* NUButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52B0F14C8B74800AB61E8 /* NUButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
69 65 3BD52B1214C8B74800AB61E8 /* NUButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B1014C8B74800AB61E8 /* NUButton.m */; };
70   - 3BD52B1314C8B74800AB61E8 /* NUButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B1014C8B74800AB61E8 /* NUButton.m */; };
71 66 3BD52B1614C8B76E00AB61E8 /* NUPickerCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52B1414C8B76E00AB61E8 /* NUPickerCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
72 67 3BD52B1714C8B76E00AB61E8 /* NUPickerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B1514C8B76E00AB61E8 /* NUPickerCell.m */; };
73   - 3BD52B1814C8B76E00AB61E8 /* NUPickerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B1514C8B76E00AB61E8 /* NUPickerCell.m */; };
74 68 3BD52B1B14C8B7A200AB61E8 /* NUMultiButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52B1914C8B7A200AB61E8 /* NUMultiButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
75 69 3BD52B1C14C8B7A200AB61E8 /* NUMultiButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B1A14C8B7A200AB61E8 /* NUMultiButton.m */; };
76   - 3BD52B1D14C8B7A200AB61E8 /* NUMultiButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B1A14C8B7A200AB61E8 /* NUMultiButton.m */; };
77 70 3BD52B2514C8B7EF00AB61E8 /* UILabel+NUResize.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BD52B2314C8B7EF00AB61E8 /* UILabel+NUResize.h */; settings = {ATTRIBUTES = (Public, ); }; };
78 71 3BD52B2614C8B7EF00AB61E8 /* UILabel+NUResize.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B2414C8B7EF00AB61E8 /* UILabel+NUResize.m */; };
79   - 3BD52B2714C8B7EF00AB61E8 /* UILabel+NUResize.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BD52B2414C8B7EF00AB61E8 /* UILabel+NUResize.m */; };
80 72 3BE8673014CDF145002D04BD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE8672F14CDF145002D04BD /* QuartzCore.framework */; };
81 73 671F3C9614C9C36D00CEE042 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 671F3C9514C9C36D00CEE042 /* UIKit.framework */; };
82 74 671F3C9914C9C37500CEE042 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 671F3C9814C9C37500CEE042 /* CoreData.framework */; };
83 75 671F3C9B14C9C38100CEE042 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 671F3C9A14C9C38100CEE042 /* CoreGraphics.framework */; };
84 76 671F3E6814C9C41000CEE042 /* libsbjson-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 671F3E4814C9C3BB00CEE042 /* libsbjson-ios.a */; };
85 77 671F3E8914CA318100CEE042 /* NUCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 671F3E8814CA318100CEE042 /* NUCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
86   - 67DB495B14D071FE009CC8C3 /* libsbjson-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 671F3E4814C9C3BB00CEE042 /* libsbjson-ios.a */; };
87 78 67DB495C14D07203009CC8C3 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 671F3C9814C9C37500CEE042 /* CoreData.framework */; };
88 79 67DB495D14D07207009CC8C3 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 671F3C9A14C9C38100CEE042 /* CoreGraphics.framework */; };
89 80 67DB495E14D07210009CC8C3 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BE8672F14CDF145002D04BD /* QuartzCore.framework */; };
@@ -179,7 +170,17 @@
179 170 /* End PBXContainerItemProxy section */
180 171
181 172 /* Begin PBXFileReference section */
  173 + 005AA6481521676300E67C10 /* NUResponseTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NUResponseTest.h; sourceTree = "<group>"; };
  174 + 005AA6491521676300E67C10 /* NUResponseTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NUResponseTest.m; sourceTree = "<group>"; };
  175 + 005AA64D152208DE00E67C10 /* NUResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NUResponse.h; path = Models/NUResponse.h; sourceTree = "<group>"; };
  176 + 005AA64E152208DE00E67C10 /* NUResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NUResponse.m; path = Models/NUResponse.m; sourceTree = "<group>"; };
  177 + 006CE3B715214DB400DD32A2 /* NUResponseSetTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NUResponseSetTest.h; sourceTree = "<group>"; };
  178 + 006CE3B815214DB400DD32A2 /* NUResponseSetTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NUResponseSetTest.m; sourceTree = "<group>"; };
182 179 0083A90B14F746F5005C1D94 /* NUConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NUConstants.h; sourceTree = "<group>"; };
  180 + 008AE62515224CE000F4F14C /* NUDatabaseTest.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = NUDatabaseTest.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; wrapsLines = 1; };
  181 + 008AE62615224CE000F4F14C /* NUDatabaseTest.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = NUDatabaseTest.m; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; wrapsLines = 1; };
  182 + 00C8457D152263DF003B9213 /* NSDateFormatter+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDateFormatter+Additions.h"; path = "Models/NSDateFormatter+Additions.h"; sourceTree = "<group>"; };
  183 + 00C8457E152263DF003B9213 /* NSDateFormatter+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDateFormatter+Additions.m"; path = "Models/NSDateFormatter+Additions.m"; sourceTree = "<group>"; };
183 184 3B08678E14FED8C100D43E02 /* group_dependency.feature */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = group_dependency.feature; sourceTree = "<group>"; };
184 185 3B24DED414EEEA8400E7D04C /* basic_survey.feature */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = basic_survey.feature; sourceTree = "<group>"; };
185 186 3B24DED614EEEABF00E7D04C /* response_set_steps.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = response_set_steps.rb; sourceTree = "<group>"; };
@@ -609,7 +610,6 @@
609 610 67DB495E14D07210009CC8C3 /* QuartzCore.framework in Frameworks */,
610 611 67DB495D14D07207009CC8C3 /* CoreGraphics.framework in Frameworks */,
611 612 67DB495C14D07203009CC8C3 /* CoreData.framework in Frameworks */,
612   - 67DB495B14D071FE009CC8C3 /* libsbjson-ios.a in Frameworks */,
613 613 3BD52AB314C8B43500AB61E8 /* SenTestingKit.framework in Frameworks */,
614 614 3BD52AB614C8B43500AB61E8 /* Foundation.framework in Frameworks */,
615 615 3BD52AB914C8B43500AB61E8 /* libNUSurveyor.a in Frameworks */,
@@ -712,9 +712,15 @@
712 712 3BD52ABA14C8B43500AB61E8 /* NUSurveyorTests */ = {
713 713 isa = PBXGroup;
714 714 children = (
  715 + 006CE3B715214DB400DD32A2 /* NUResponseSetTest.h */,
  716 + 006CE3B815214DB400DD32A2 /* NUResponseSetTest.m */,
715 717 3BD52AC014C8B43500AB61E8 /* NUSurveyorTests.h */,
716 718 3BD52AC114C8B43500AB61E8 /* NUSurveyorTests.m */,
717 719 3BD52ABB14C8B43500AB61E8 /* Supporting Files */,
  720 + 008AE62515224CE000F4F14C /* NUDatabaseTest.h */,
  721 + 008AE62615224CE000F4F14C /* NUDatabaseTest.m */,
  722 + 005AA6481521676300E67C10 /* NUResponseTest.h */,
  723 + 005AA6491521676300E67C10 /* NUResponseTest.m */,
718 724 );
719 725 path = NUSurveyorTests;
720 726 sourceTree = "<group>";
@@ -779,6 +785,10 @@
779 785 3BD52AE314C8B65400AB61E8 /* NUResponseSet.m */,
780 786 3BA2E94814CDCD0F0057D05C /* NUSurvey.h */,
781 787 3BA2E94914CDCD0F0057D05C /* NUSurvey.m */,
  788 + 005AA64D152208DE00E67C10 /* NUResponse.h */,
  789 + 005AA64E152208DE00E67C10 /* NUResponse.m */,
  790 + 00C8457D152263DF003B9213 /* NSDateFormatter+Additions.h */,
  791 + 00C8457E152263DF003B9213 /* NSDateFormatter+Additions.m */,
782 792 );
783 793 name = Models;
784 794 sourceTree = "<group>";
@@ -1895,6 +1905,8 @@
1895 1905 3BD52B1114C8B74800AB61E8 /* NUButton.h in Headers */,
1896 1906 3BD52B1B14C8B7A200AB61E8 /* NUMultiButton.h in Headers */,
1897 1907 3BD52B2514C8B7EF00AB61E8 /* UILabel+NUResize.h in Headers */,
  1908 + 005AA64F152208DE00E67C10 /* NUResponse.h in Headers */,
  1909 + 00C8457F152263DF003B9213 /* NSDateFormatter+Additions.h in Headers */,
1898 1910 67DB499814D0933E009CC8C3 /* NUGridAnyCell.h in Headers */,
1899 1911 67DB499A14D0933E009CC8C3 /* NUGridOneCell.h in Headers */,
1900 1912 0083A90C14F746F5005C1D94 /* NUConstants.h in Headers */,
@@ -1985,6 +1997,7 @@
1985 1997 isa = PBXProject;
1986 1998 attributes = {
1987 1999 LastUpgradeCheck = 0420;
  2000 + ORGANIZATIONNAME = "Northwestern University";
1988 2001 };
1989 2002 buildConfigurationList = 3BD52A9B14C8B43400AB61E8 /* Build configuration list for PBXProject "NUSurveyor" */;
1990 2003 compatibilityVersion = "Xcode 3.2";
@@ -2146,10 +2159,12 @@
2146 2159 3BA2E94B14CDCD0F0057D05C /* NUSurvey.m in Sources */,
2147 2160 67DB499914D0933E009CC8C3 /* NUGridAnyCell.m in Sources */,
2148 2161 67DB499B14D0933E009CC8C3 /* NUGridOneCell.m in Sources */,
  2162 + 005AA650152208DE00E67C10 /* NUResponse.m in Sources */,
2149 2163 3BC61A7F1520CBDB00A8C20C /* NUAnyStringOrNumberCell.m in Sources */,
2150 2164 3BC61A851520F75000A8C20C /* NUAnyDatePickerCell.m in Sources */,
2151 2165 3B2AB06F1522429E00525F25 /* NUOneStringOrNumberCell.m in Sources */,
2152 2166 3B2AB0731522483E00525F25 /* NUOneDatePickerCell.m in Sources */,
  2167 + 00C84580152263DF003B9213 /* NSDateFormatter+Additions.m in Sources */,
2153 2168 );
2154 2169 runOnlyForDeploymentPostprocessing = 0;
2155 2170 };
@@ -2157,23 +2172,11 @@
2157 2172 isa = PBXSourcesBuildPhase;
2158 2173 buildActionMask = 2147483647;
2159 2174 files = (
  2175 + 005AA64B1521F04B00E67C10 /* NUResponseSetTest.m in Sources */,
  2176 + 005AA64C1521F04B00E67C10 /* NUResponseTest.m in Sources */,
2160 2177 3BD52AC214C8B43500AB61E8 /* NUSurveyorTests.m in Sources */,
2161   - 3BD52AD214C8B5A200AB61E8 /* NUSurveyTVC.m in Sources */,
2162   - 3BD52AD714C8B5B600AB61E8 /* NUSectionTVC.m in Sources */,
2163   - 3BD52ADC14C8B5FE00AB61E8 /* UUID.m in Sources */,
2164   - 3BD52AE114C8B62600AB61E8 /* NUPickerVC.m in Sources */,
2165   - 3BD52AE614C8B65400AB61E8 /* NUResponseSet.m in Sources */,
2166   - 3BD52AEB14C8B6A400AB61E8 /* NUAnyCell.m in Sources */,
2167   - 3BD52AF014C8B6B900AB61E8 /* NUDatePickerCell.m in Sources */,
2168   - 3BD52AFF14C8B6E900AB61E8 /* NUNoneCell.m in Sources */,
2169   - 3BD52B0414C8B6F700AB61E8 /* NUNoneTextCell.m in Sources */,
2170   - 3BD52B0914C8B70500AB61E8 /* NUOneCell.m in Sources */,
2171   - 3BD52B1314C8B74800AB61E8 /* NUButton.m in Sources */,
2172   - 3BD52B1814C8B76E00AB61E8 /* NUPickerCell.m in Sources */,
2173   - 3BD52B1D14C8B7A200AB61E8 /* NUMultiButton.m in Sources */,
2174   - 3BD52B2714C8B7EF00AB61E8 /* UILabel+NUResize.m in Sources */,
2175   - 3BA2E94C14CDCD0F0057D05C /* NUSurvey.m in Sources */,
2176 2178 67DB499314D085CA009CC8C3 /* NUSurveyor.xcdatamodel in Sources */,
  2179 + 008AE62715224CE000F4F14C /* NUDatabaseTest.m in Sources */,
2177 2180 );
2178 2181 runOnlyForDeploymentPostprocessing = 0;
2179 2182 };
@@ -2381,6 +2384,7 @@
2381 2384 GCC_PRECOMPILE_PREFIX_HEADER = YES;
2382 2385 GCC_PREFIX_HEADER = "NUSurveyor/NUSurveyor-Prefix.pch";
2383 2386 INFOPLIST_FILE = "NUSurveyorTests/NUSurveyorTests-Info.plist";
  2387 + OTHER_LDFLAGS = "-all_load";
2384 2388 PRODUCT_NAME = "$(TARGET_NAME)";
2385 2389 WRAPPER_EXTENSION = octest;
2386 2390 };
@@ -2396,6 +2400,7 @@
2396 2400 GCC_PRECOMPILE_PREFIX_HEADER = YES;
2397 2401 GCC_PREFIX_HEADER = "NUSurveyor/NUSurveyor-Prefix.pch";
2398 2402 INFOPLIST_FILE = "NUSurveyorTests/NUSurveyorTests-Info.plist";
  2403 + OTHER_LDFLAGS = "-all_load";
2399 2404 PRODUCT_NAME = "$(TARGET_NAME)";
2400 2405 WRAPPER_EXTENSION = octest;
2401 2406 };
15 NUSurveyor/Models/NSDateFormatter+Additions.h
... ... @@ -0,0 +1,15 @@
  1 +//
  2 +// NSDateFormatter+Additions.h
  3 +// NUSurveyor
  4 +//
  5 +// Created by John Dzak on 3/27/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +@interface NSDateFormatter (Additions)
  12 +
  13 ++ (NSDateFormatter*) rfc3339DateFormatter;
  14 +
  15 +@end
21 NUSurveyor/Models/NSDateFormatter+Additions.m
... ... @@ -0,0 +1,21 @@
  1 +//
  2 +// NSDateFormatter+Additions.m
  3 +// NUSurveyor
  4 +//
  5 +// Created by John Dzak on 3/27/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import "NSDateFormatter+Additions.h"
  10 +
  11 +@implementation NSDateFormatter (Additions)
  12 +
  13 ++ (NSDateFormatter*) rfc3339DateFormatter {
  14 + NSDateFormatter* f = [[NSDateFormatter alloc] init];
  15 + [f setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
  16 + [f setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
  17 + [f setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
  18 + return f;
  19 +}
  20 +
  21 +@end
16 NUSurveyor/Models/NUResponse.h
... ... @@ -0,0 +1,16 @@
  1 +//
  2 +// NUResponse.h
  3 +// NUSurveyor
  4 +//
  5 +// Created by John Dzak on 3/27/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import <CoreData/CoreData.h>
  10 +
  11 +@interface NUResponse : NSManagedObject
  12 +
  13 +- (NSDictionary*) toDict;
  14 +- (NSString*) toJson;
  15 +
  16 +@end
33 NUSurveyor/Models/NUResponse.m
... ... @@ -0,0 +1,33 @@
  1 +//
  2 +// NUResponse.m
  3 +// NUSurveyor
  4 +//
  5 +// Created by John Dzak on 3/27/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import "NUResponse.h"
  10 +#import "SBJson.h"
  11 +#import "NSDateFormatter+Additions.h"
  12 +
  13 +@implementation NUResponse
  14 +
  15 +- (NSDictionary*) toDict {
  16 + NSString* createdAt = [[NSDateFormatter rfc3339DateFormatter] stringFromDate:[self valueForKey:@"createdAt"]];
  17 + NSString* modifiedAt = [[NSDateFormatter rfc3339DateFormatter] stringFromDate:[self valueForKey:@"modifiedAt"]];
  18 +
  19 + return [[NSDictionary alloc] initWithObjectsAndKeys:
  20 + [self valueForKey:@"uuid"], @"uuid",
  21 + [self valueForKey:@"answer"], @"answer_id",
  22 + [self valueForKey:@"question"], @"question_id",
  23 + [self valueForKey:@"value"], @"value",
  24 + createdAt, @"created_at",
  25 + modifiedAt, @"modified_at", nil];
  26 +}
  27 +
  28 +- (NSString*) toJson {
  29 + SBJsonWriter* w = [[SBJsonWriter alloc] init];
  30 + return [w stringWithObject:[self toDict]];
  31 +}
  32 +
  33 +@end
9 NUSurveyor/Models/NUResponseSet.h
@@ -8,24 +8,29 @@
8 8
9 9 #import <CoreData/CoreData.h>
10 10
  11 +@class NUResponse;
  12 +
11 13 @interface NUResponseSet : NSManagedObject
12 14
13 15 @property (nonatomic, retain) NSMutableDictionary *dependencyGraph;
14 16 @property (nonatomic, retain) NSMutableDictionary *dependencies;
15 17 @property (nonatomic, strong) NSString *uuid;
  18 +@property (nonatomic, retain) NSSet* responses;
16 19
17 20 + (NUResponseSet *) newResponseSetForSurvey:(NSDictionary *)survey withModel:(NSManagedObjectModel *)mom inContext:(NSManagedObjectContext *)moc;
18 21 + (void) saveContext:(NSManagedObjectContext *)moc withMessage:(NSString *)message;
19 22 - (NSUInteger) responseCount;
20 23 - (NSArray *) responsesForQuestion:(NSString *)qid;
21 24 - (NSArray *) responsesForQuestion:(NSString *)qid Answer:(NSString *)aid;
22   -- (NSManagedObject *) newResponseForQuestion:(NSString *)qid Answer:(NSString *)aid Value:(NSString *)value;
23   -- (NSManagedObject *) newResponseForIndexQuestion:(NSString *)qid Answer:(NSString *)aid;
  25 +- (NUResponse *) newResponseForQuestion:(NSString *)qid Answer:(NSString *)aid Value:(NSString *)value;
  26 +- (NUResponse *) newResponseForIndexQuestion:(NSString *)qid Answer:(NSString *)aid;
24 27 - (void) deleteResponseForQuestion:(NSString *)qid Answer:(NSString *)aid;
25 28
26 29 - (void) generateDependencyGraph:(NSDictionary *)survey;
27 30 - (NSDictionary *) dependenciesTriggeredBy:(NSString *)qid;
28 31 - (BOOL) showDependency:(NSDictionary *)q;
29 32 - (NSMutableDictionary *) evaluateConditions:(NSArray *)conditions;
  33 +- (NSDictionary*) toDict;
  34 +- (NSString*) toJson;
30 35
31 36 @end
33 NUSurveyor/Models/NUResponseSet.m
@@ -8,10 +8,13 @@
8 8
9 9 #import "NUResponseSet.h"
10 10 #import "UUID.h"
  11 +#import "NUResponse.h"
  12 +#import "SBJson.h"
  13 +#import "NSDateFormatter+Additions.h"
11 14
12 15 @implementation NUResponseSet
13 16 @synthesize dependencyGraph = _dependencyGraph, dependencies = _dependencies;
14   -@dynamic uuid;
  17 +@dynamic uuid, responses;
15 18
16 19 // initializer
17 20 + (NUResponseSet *) newResponseSetForSurvey:(NSDictionary *)survey withModel:(NSManagedObjectModel *)mom inContext:(NSManagedObjectContext *)moc {
@@ -126,9 +129,10 @@ - (NSArray *) responsesForQuestion:(NSString *)qid Answer:(NSString *)aid {
126 129 //
127 130 // Create a response with value
128 131 //
129   -- (NSManagedObject *) newResponseForQuestion:(NSString *)qid Answer:(NSString *)aid Value:(NSString *)value{
130   -
131   - NSManagedObject *newResponse = [NSEntityDescription insertNewObjectForEntityForName:@"Response" inManagedObjectContext:self.managedObjectContext];
  132 +- (NUResponse *) newResponseForQuestion:(NSString *)qid Answer:(NSString *)aid Value:(NSString *)value{
  133 + NSDictionary* entities = [[[self.managedObjectContext persistentStoreCoordinator] managedObjectModel] entitiesByName];
  134 + NSEntityDescription *entity = [entities objectForKey:@"Response"];
  135 + NUResponse* newResponse = [[NUResponse alloc] initWithEntity:entity insertIntoManagedObjectContext:self.managedObjectContext];
132 136 [newResponse setValue:self forKey:@"responseSet"];
133 137 [newResponse setValue:qid forKey:@"question"];
134 138 [newResponse setValue:aid forKey:@"answer"];
@@ -341,4 +345,25 @@ - (NSMutableDictionary *) evaluateConditions:(NSArray *)conditions {
341 345 return values;
342 346 }
343 347
  348 +- (NSDictionary*) toDict {
  349 + NSMutableArray* responseDictionaries = [NSMutableArray new];
  350 + for (NUResponse* r in [self responses]) {
  351 + [responseDictionaries addObject:[r toDict]];
  352 + }
  353 + NSString* createdAt = [[NSDateFormatter rfc3339DateFormatter] stringFromDate:[self valueForKey:@"createdAt"]];
  354 + NSString* completedAt = [[NSDateFormatter rfc3339DateFormatter] stringFromDate:[self valueForKey:@"completedAt"]];
  355 + return [[NSDictionary alloc]initWithObjectsAndKeys:
  356 + [self valueForKey:@"uuid"], @"uuid",
  357 + [self valueForKey:@"survey"], @"survey_id",
  358 + createdAt, @"created_at",
  359 + completedAt, @"completed_at",
  360 + [self valueForKey:@"completedAt"], @"created_at",
  361 + responseDictionaries, @"responses", nil];
  362 +}
  363 +
  364 +- (NSString*) toJson {
  365 + SBJsonWriter* w = [[SBJsonWriter alloc] init];
  366 + return [w stringWithObject:[self toDict]];
  367 +}
  368 +
344 369 @end
2  NUSurveyorExample/NUSurveyorExample.xcdatamodel/contents
... ... @@ -1,6 +1,6 @@
1 1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 2 <model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="872" systemVersion="10K549" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
3   - <entity name="Response" representedClassName="NUResponseSet" syncable="YES">
  3 + <entity name="Response" representedClassName="NUResponse" syncable="YES">
4 4 <attribute name="answer" optional="YES" attributeType="String" syncable="YES"/>
5 5 <attribute name="createdAt" optional="YES" attributeType="Date" syncable="YES"/>
6 6 <attribute name="modifiedAt" optional="YES" attributeType="Date" syncable="YES"/>
23 NUSurveyorTests/NUDatabaseTest.h
... ... @@ -0,0 +1,23 @@
  1 +//
  2 +// NUDatabaseTest.h
  3 +//
  4 +//
  5 +// Created by John Dzak on 3/27/12.
  6 +// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
  7 +//
  8 +
  9 +#import <SenTestingKit/SenTestingKit.h>
  10 +#import <CoreData/CoreData.h>
  11 +
  12 +@interface NUDatabaseTest : SenTestCase
  13 +
  14 +@property (nonatomic, strong) NSBundle *bundle;
  15 +@property (nonatomic, strong) NSPersistentStoreCoordinator *coord;
  16 +@property (nonatomic, strong) NSManagedObjectContext *ctx;
  17 +@property (nonatomic, strong) NSManagedObjectModel *model;
  18 +@property (nonatomic, strong) NSPersistentStore *store;
  19 +
  20 +- (void)setUp;
  21 +- (void)tearDown;
  22 +
  23 +@end
51 NUSurveyorTests/NUDatabaseTest.m
... ... @@ -0,0 +1,51 @@
  1 +//
  2 +// NUDatabaseTest.m
  3 +//
  4 +//
  5 +// Created by John Dzak on 3/27/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import "NUDatabaseTest.h"
  10 +
  11 +@implementation NUDatabaseTest
  12 +
  13 +@synthesize bundle = _bundle, coord = _coord, ctx = _ctx, model = _model, store = _store;
  14 +
  15 +- (void)setUp
  16 +{
  17 + [super setUp];
  18 +
  19 + // Set-up code here.
  20 + self.bundle = [NSBundle bundleWithIdentifier:@"NUBIC.NUSurveyorTests"];
  21 + self.model = [[NSManagedObjectModel alloc] initWithContentsOfURL:[self.bundle URLForResource:@"NUSurveyor" withExtension:@"mom"]];
  22 + self.coord = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: self.model];
  23 + self.store = [self.coord addPersistentStoreWithType: NSInMemoryStoreType
  24 + configuration: nil
  25 + URL: nil
  26 + options: nil
  27 + error: NULL];
  28 + self.ctx = [[NSManagedObjectContext alloc] init];
  29 + [self.ctx setPersistentStoreCoordinator: self.coord];
  30 +}
  31 +
  32 +- (void)tearDown
  33 +{
  34 + // Tear-down code here.
  35 + self.ctx = nil;
  36 + NSError *error = nil;
  37 + STAssertTrue([self.coord removePersistentStore: self.store error: &error],
  38 + @"couldn't remove persistent store: %@", error);
  39 + self.store = nil;
  40 + self.coord = nil;
  41 + self.model = nil;
  42 + self.bundle = nil;
  43 +
  44 + [super tearDown];
  45 +}
  46 +
  47 +- (void)testThatEnvironmentWorks {
  48 + STAssertNotNil(self.store, @"no persistent store");
  49 +}
  50 +
  51 +@end
14 NUSurveyorTests/NUResponseSetTest.h
... ... @@ -0,0 +1,14 @@
  1 +//
  2 +// NUResponsetSetTest.h
  3 +// NUSurveyor
  4 +//
  5 +// Created by John Dzak on 3/26/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import <SenTestingKit/SenTestingKit.h>
  10 +#import "NUDatabaseTest.h"
  11 +
  12 +@interface NUResponseSetTest : NUDatabaseTest
  13 +
  14 +@end
60 NUSurveyorTests/NUResponseSetTest.m
... ... @@ -0,0 +1,60 @@
  1 +//
  2 +// NUResponsetSetTest.m
  3 +// NUSurveyor
  4 +//
  5 +// Created by John Dzak on 3/26/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import "NUResponseSetTest.h"
  10 +#import "NUResponseSet.h"
  11 +#import "NUSurvey.h"
  12 +#import "NSDateFormatter+Additions.h"
  13 +
  14 +@implementation NUResponseSetTest
  15 +
  16 +NUResponseSet* rs;
  17 +NSDate* createdAt;
  18 +NSDate* completedAt;
  19 +
  20 +- (void)setUp {
  21 + [super setUp];
  22 + createdAt = [[NSDateFormatter rfc3339DateFormatter] dateFromString:@"1970-02-04T05:15:30Z"];
  23 + completedAt = [[NSDateFormatter rfc3339DateFormatter] dateFromString:@"1990-03-06T07:21:42Z"];
  24 +
  25 + NSDictionary* s = [[NSDictionary alloc] initWithObjectsAndKeys:@"RECT", @"uuid", nil];
  26 + rs = [NUResponseSet newResponseSetForSurvey:s withModel:self.model inContext:self.ctx];
  27 + [rs setValue:@"OVAL" forKey:@"uuid"];
  28 + [rs setValue:createdAt forKey:@"createdAt"];
  29 + [rs setValue:completedAt forKey:@"completedAt"];
  30 +
  31 + [rs newResponseForQuestion:@"abc" Answer:@"123" Value:@"foo"];
  32 + [rs newResponseForQuestion:@"xyz" Answer:@"456" Value:@"bar"];
  33 +}
  34 +
  35 +- (void)testSanity {
  36 + NUResponseSet* rs = [NUResponseSet newResponseSetForSurvey:[NSDictionary dictionary] withModel:self.model inContext:self.ctx];
  37 + [rs newResponseForIndexQuestion:@"abc" Answer:@"123"];
  38 +
  39 + STAssertEquals(1U, [[rs responsesForQuestion:@"abc" Answer:@"123"] count], @"Should have one element");
  40 +}
  41 +
  42 +- (void)testToDict {
  43 + NSDictionary* actual = [rs toDict];
  44 + STAssertEqualObjects([actual objectForKey:@"uuid"], @"OVAL", @"Wrong value");
  45 + STAssertEqualObjects([actual objectForKey:@"survey_id"], @"RECT", @"Wrong value");
  46 + STAssertEqualObjects([actual objectForKey:@"created_at"], @"1970-02-04T05:15:30Z", @"Wrong value");
  47 + STAssertEqualObjects([actual objectForKey:@"completed_at"], @"1990-03-06T07:21:42Z", @"Wrong value");
  48 + STAssertEquals([[actual objectForKey:@"responses"] count], 2U, @"Wrong size");
  49 +}
  50 +
  51 +- (void) testToJson {
  52 + NSString* actual = [rs toJson];
  53 + STAssertTrue([actual rangeOfString:@"\"uuid\":\"OVAL\""].location != NSNotFound, @"Should exist");
  54 + STAssertTrue([actual rangeOfString:@"\"survey_id\":\"RECT\""].location != NSNotFound, @"Should exist");
  55 + STAssertTrue([actual rangeOfString:@"\"created_at\":\"1970-02-04T05:15:30Z\""].location != NSNotFound, @"Should exist");
  56 + STAssertTrue([actual rangeOfString:@"\"completed_at\":\"1990-03-06T07:21:42Z\""].location != NSNotFound, @"Should exist");
  57 + STAssertTrue([actual rangeOfString:@"\"responses\":["].location != NSNotFound, @"Should exist");
  58 +}
  59 +
  60 +@end
15 NUSurveyorTests/NUResponseTest.h
... ... @@ -0,0 +1,15 @@
  1 +//
  2 +// NUResponseTest.h
  3 +// NUSurveyor
  4 +//
  5 +// Created by John Dzak on 3/26/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import <SenTestingKit/SenTestingKit.h>
  10 +
  11 +#import "NUDatabaseTest.h"
  12 +
  13 +@interface NUResponseTest : NUDatabaseTest
  14 +
  15 +@end
61 NUSurveyorTests/NUResponseTest.m
... ... @@ -0,0 +1,61 @@
  1 +//
  2 +// NUResponseTest.m
  3 +// NUSurveyor
  4 +//
  5 +// Created by John Dzak on 3/26/12.
  6 +// Copyright (c) 2012 Northwestern University. All rights reserved.
  7 +//
  8 +
  9 +#import "NUResponseTest.h"
  10 +#import "NUResponseSet.h"
  11 +#import "NUResponse.h"
  12 +#import "NSDateFormatter+Additions.h"
  13 +
  14 +@implementation NUResponseTest
  15 +
  16 +NUResponse* response;
  17 +NSDate* createdAt;
  18 +NSDate* modifiedAt;
  19 +
  20 +- (void)setUp {
  21 + [super setUp];
  22 +
  23 + createdAt = [[NSDateFormatter rfc3339DateFormatter] dateFromString:@"1970-02-04T05:15:30Z"];
  24 + modifiedAt = [[NSDateFormatter rfc3339DateFormatter] dateFromString:@"1990-03-06T07:21:42Z"];
  25 +
  26 + NSDictionary* s = [[NSDictionary alloc] initWithObjectsAndKeys:@"RECT", @"uuid", nil];
  27 + NUResponseSet* rs = [NUResponseSet newResponseSetForSurvey:s withModel:self.model inContext:self.ctx];
  28 + response = [rs newResponseForQuestion:@"abc" Answer:@"123" Value:@"foo"];
  29 + [response setValue:@"OCT" forKey:@"uuid"];
  30 + [response setValue:createdAt forKey:@"createdAt"];
  31 + [response setValue:modifiedAt forKey:@"modifiedAt"];
  32 +}
  33 +
  34 +- (void)testSanity {
  35 + NUResponseSet* rs = [NUResponseSet newResponseSetForSurvey:[NSDictionary dictionary] withModel:self.model inContext:self.ctx];
  36 + [rs newResponseForIndexQuestion:@"abc" Answer:@"123"];
  37 +
  38 + STAssertEquals(1U, [[rs responsesForQuestion:@"abc" Answer:@"123"] count], @"Should have one element");
  39 +}
  40 +
  41 +- (void)testToDict {
  42 + NSDictionary* actual = [response toDict];
  43 + STAssertEqualObjects([actual objectForKey:@"value"], @"foo", @"Wrong value");
  44 + STAssertEqualObjects([actual objectForKey:@"answer_id"], @"123", @"Wrong value");
  45 + STAssertEqualObjects([actual objectForKey:@"question_id"], @"abc", @"Wrong value");
  46 + STAssertEqualObjects([actual objectForKey:@"uuid"], @"OCT", @"Wrong value");
  47 + STAssertEqualObjects([actual objectForKey:@"created_at"], @"1970-02-04T05:15:30Z", @"Wrong value");
  48 + STAssertEqualObjects([actual objectForKey:@"modified_at"], @"1990-03-06T07:21:42Z", @"Wrong value");
  49 +}
  50 +
  51 +- (void)testToJson {
  52 + NSString* actual = [response toJson];
  53 + STAssertTrue([actual rangeOfString:@"\"value\":\"foo\""].location != NSNotFound, @"Should exist");
  54 + STAssertTrue([actual rangeOfString:@"\"answer_id\":\"123\""].location != NSNotFound, @"Should exist");
  55 + STAssertTrue([actual rangeOfString:@"\"question_id\":\"abc\""].location != NSNotFound, @"Should exist");
  56 + STAssertTrue([actual rangeOfString:@"\"uuid\":\"OCT\""].location != NSNotFound, @"Should exist");
  57 + STAssertTrue([actual rangeOfString:@"\"created_at\":\"1970-02-04T05:15:30Z\""].location != NSNotFound, @"Should exist");
  58 + STAssertTrue([actual rangeOfString:@"\"modified_at\":\"1990-03-06T07:21:42Z\""].location != NSNotFound, @"Should exist");
  59 +}
  60 +
  61 +@end
2  NUSurveyorTests/NUSurveyor.xcdatamodel/contents
... ... @@ -1,6 +1,6 @@
1 1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 2 <model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="872" systemVersion="10K549" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
3   - <entity name="Response" representedClassName="NUResponseSet" syncable="YES">
  3 + <entity name="Response" representedClassName="NUResponse" syncable="YES">
4 4 <attribute name="answer" optional="YES" attributeType="String" syncable="YES"/>
5 5 <attribute name="createdAt" optional="YES" attributeType="Date" syncable="YES"/>
6 6 <attribute name="modifiedAt" optional="YES" attributeType="Date" syncable="YES"/>
10 NUSurveyorTests/NUSurveyorTests.h
@@ -7,14 +7,8 @@
7 7 //
8 8
9 9 #import <SenTestingKit/SenTestingKit.h>
10   -#import <CoreData/CoreData.h>
  10 +#import "NUDatabaseTest.h"
11 11
12   -@interface NUSurveyorTests : SenTestCase
13   -
14   -@property (nonatomic, strong) NSBundle *bundle;
15   -@property (nonatomic, strong) NSPersistentStoreCoordinator *coord;
16   -@property (nonatomic, strong) NSManagedObjectContext *ctx;
17   -@property (nonatomic, strong) NSManagedObjectModel *model;
18   -@property (nonatomic, strong) NSPersistentStore *store;
  12 +@interface NUSurveyorTests : NUDatabaseTest
19 13
20 14 @end
36 NUSurveyorTests/NUSurveyorTests.m
@@ -13,42 +13,6 @@
13 13 #import "SBJson.h"
14 14
15 15 @implementation NUSurveyorTests
16   -@synthesize bundle = _bundle, coord = _coord, ctx = _ctx, model = _model, store = _store;
17   -- (void)setUp
18   -{
19   - [super setUp];
20   -
21   - // Set-up code here.
22   - self.bundle = [NSBundle bundleWithIdentifier:@"NUBIC.NUSurveyorTests"];
23   - self.model = [[NSManagedObjectModel alloc] initWithContentsOfURL:[self.bundle URLForResource:@"NUSurveyor" withExtension:@"mom"]];
24   - self.coord = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: self.model];
25   - self.store = [self.coord addPersistentStoreWithType: NSInMemoryStoreType
26   - configuration: nil
27   - URL: nil
28   - options: nil
29   - error: NULL];
30   - self.ctx = [[NSManagedObjectContext alloc] init];
31   - [self.ctx setPersistentStoreCoordinator: self.coord];
32   -}
33   -
34   -- (void)tearDown
35   -{
36   - // Tear-down code here.
37   - self.ctx = nil;
38   - NSError *error = nil;
39   - STAssertTrue([self.coord removePersistentStore: self.store error: &error],
40   - @"couldn't remove persistent store: %@", error);
41   - self.store = nil;
42   - self.coord = nil;
43   - self.model = nil;
44   - self.bundle = nil;
45   -
46   - [super tearDown];
47   -}
48   -- (void)testThatEnvironmentWorks
49   -{
50   - STAssertNotNil(self.store, @"no persistent store");
51   -}
52 16
53 17 - (void)testUUID{
54 18 NSString *str = [UUID generateUuidString];

0 comments on commit a8aefb5

Please sign in to comment.
Something went wrong with that request. Please try again.