XCodeContext implements IXCodeContext { public String getCodeSignIdentity() { return settings.getAllSettings().get(Settings.ManagedSetting.CODE_SIGN_IDENTITY.name()); } XCodeContext(List<String> buildActions,
        File projectRootDirectory, PrintStream out, Settings settings, Options options); String getProjectName(); List<String> getBuildActions(); String getCodeSignIdentity(); File getProjectRootDirectory(); PrintStream getOut(); final void setOut(PrintStream out); @Override String getSDK(); @Override String getConfiguration(); String getProvisioningProfile(); String getTarget(); Options getOptions(); Settings getSettings(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testCodeSignIdentityIsNull() throws Exception { Map<String, String> managedOptions = new HashMap<String, String>(); managedOptions.put(Options.ManagedOption.CONFIGURATION.getOptionName(), "Release"); managedOptions.put(Options.ManagedOption.SDK.getOptionName(), "mysdk"); managedOptions.put(Options.ManagedOption.PROJECT.getOptionName(), "MyLibrary.xcodeproj"); Options options = new Options(null, managedOptions); final XCodeContext xCodeContext = new XCodeContext(Arrays.asList("clean", "build"), projectDirectory, System.out, null, options); Assert.assertNull(xCodeContext.getCodeSignIdentity()); }
@Test public void testCodeSignIdentityIsEmpty() throws Exception { Map<String, String> managedOptions = new HashMap<String, String>(); managedOptions.put(Options.ManagedOption.CONFIGURATION.getOptionName(), "Release"); managedOptions.put(Options.ManagedOption.SDK.getOptionName(), "mysdk"); managedOptions.put(Options.ManagedOption.PROJECT.getOptionName(), "MyLibrary.xcodeproj"); Options options = new Options(null, managedOptions); HashMap<String, String> managedSettings = new HashMap<String, String>(); managedSettings.put(Settings.ManagedSetting.CODE_SIGN_IDENTITY.name(), ""); Settings settings = new Settings(null, managedSettings); XCodeContext context = new XCodeContext(Arrays.asList("clean", "build"), projectDirectory, System.out, settings, options); assertEquals("", context.getCodeSignIdentity()); }