Browse Source

IOSAD-191 Move pEpLanguageWithAllFieldsFilled to PEPTypesTestUtil.

IOSAD-191
David Alarcon 1 year ago
parent
commit
92b7589ec3
3 changed files with 16 additions and 14 deletions
  1. +3
    -13
      PEPObjCAdapterTypesTests_iOS/PEPLanguage+SecureCodingTest.m
  2. +2
    -1
      PEPObjCAdapterTypesTests_iOS/TestUtils/PEPTypesTestUtil.h
  3. +11
    -0
      PEPObjCAdapterTypesTests_iOS/TestUtils/PEPTypesTestUtil.m

+ 3
- 13
PEPObjCAdapterTypesTests_iOS/PEPLanguage+SecureCodingTest.m View File

@ -27,21 +27,21 @@
}
- (void)testLanguageCode {
PEPLanguage *testee = [self languageWithAllFieldsFilled];
PEPLanguage *testee = [PEPTypesTestUtil pEpLanguageWithAllFieldsFilled];
PEPLanguage *unarchivedTestee = [self archiveAndUnarchiveLanguage:testee];
XCTAssertEqualObjects(testee.code, unarchivedTestee.code);
}
- (void)testLanguageName {
PEPLanguage *testee = [self languageWithAllFieldsFilled];
PEPLanguage *testee = [PEPTypesTestUtil pEpLanguageWithAllFieldsFilled];
PEPLanguage *unarchivedTestee = [self archiveAndUnarchiveLanguage:testee];
XCTAssertEqualObjects(testee.name, unarchivedTestee.name);
}
- (void)testLanguageSentence {
PEPLanguage *testee = [self languageWithAllFieldsFilled];
PEPLanguage *testee = [PEPTypesTestUtil pEpLanguageWithAllFieldsFilled];
PEPLanguage *unarchivedTestee = [self archiveAndUnarchiveLanguage:testee];
XCTAssertEqualObjects(testee.sentence, unarchivedTestee.sentence);
@ -64,14 +64,4 @@
return unarchivedLanguage;
}
- (PEPLanguage *)languageWithAllFieldsFilled {
PEPLanguage *language = [PEPLanguage new];
language.code = @"cat";
language.name = @"Català";
language.sentence = @"Bon profit";
return language;
}
@end

+ 2
- 1
PEPObjCAdapterTypesTests_iOS/TestUtils/PEPTypesTestUtil.h View File

@ -10,11 +10,12 @@
NS_ASSUME_NONNULL_BEGIN
@class PEPIdentity, PEPAttachment;
@class PEPIdentity, PEPAttachment, PEPLanguage;
@interface PEPTypesTestUtil : NSObject
+ (PEPIdentity *)pEpIdentityWithAllFieldsFilled;
+ (PEPAttachment *)pEpAttachmentWithAllFieldsFilled;
+ (PEPLanguage *)pEpLanguageWithAllFieldsFilled;
@end


+ 11
- 0
PEPObjCAdapterTypesTests_iOS/TestUtils/PEPTypesTestUtil.m View File

@ -10,6 +10,7 @@
#import "PEPIdentity.h"
#import "PEPAttachment.h"
#import "PEPLanguage.h"
@implementation PEPTypesTestUtil
@ -39,4 +40,14 @@
return attachment;
}
+ (PEPLanguage *)pEpLanguageWithAllFieldsFilled {
PEPLanguage *language = [PEPLanguage new];
language.code = @"cat";
language.name = @"Català";
language.sentence = @"Bon profit";
return language;
}
@end

Loading…
Cancel
Save