public void testIsContextValid() { EodStagingData data = new EodStagingData(); data.setInput(TNMStagingCSharp.Src.Staging.Staging.CTX_YEAR_CURRENT, "2018"); // test valid year data.setInput(EodInput.DX_YEAR, "2018"); Assert.IsTrue(_STAGING.isContextValid("urethra", StagingData.YEAR_DX_KEY, data.getInput())); // test invalid year data.setInput(EodInput.DX_YEAR, "2016"); Assert.IsFalse(_STAGING.isContextValid("urethra", StagingData.YEAR_DX_KEY, data.getInput())); }
public void testBadLookupInStage() { EodStagingData data = new EodStagingData(); // if site/hist are not supplied, no lookup _STAGING.stage(data); Assert.AreEqual(StagingData.Result.FAILED_MISSING_SITE_OR_HISTOLOGY, data.getResult()); // add hist only and it should fail with same result data.setInput(EodInput.PRIMARY_SITE, "C489"); _STAGING.stage(data); Assert.AreEqual(StagingData.Result.FAILED_MISSING_SITE_OR_HISTOLOGY, data.getResult()); // put a site/hist combo that doesn't match a schema data.setInput(EodInput.HISTOLOGY, "9898"); _STAGING.stage(data); Assert.AreEqual(StagingData.Result.FAILED_NO_MATCHING_SCHEMA, data.getResult()); // now a site/hist that returns multiple results data.setInput(EodInput.PRIMARY_SITE, "C111"); data.setInput(EodInput.HISTOLOGY, "8200"); _STAGING.stage(data); Assert.AreEqual(StagingData.Result.FAILED_MULITPLE_MATCHING_SCHEMAS, data.getResult()); }