public void TestUpdateSingleItem(Enums.ResourceType resourceType, WriteInvalidMemoInput valueType, int expectedCode) { var phase = UpdateSinglePhaseInstance(resourceType, valueType); var error = PhaseHelper.WritePhaseFail(phase); Assert.That(error, Is.Not.Null, string.Format(Enums.Message.CREATE_RESOURCE_ENTRY_FAILED, resourceType)); Assert.That(error.Code, Is.EqualTo(expectedCode), Enums.Message.WRONG_ERROR_CODE); }
public void TestCreateSingleItem(ResourceType resourceType, string fieldName, string fieldValue, int expectedCode) { Phase phase = PhaseHelper.CreatePhaseInstance(records, resourceType); phase.DictionaryValues[fieldName] = fieldValue; var error = PhaseHelper.WritePhaseFail(phase); Assert.That(error, Is.Not.Null, string.Format(Enums.Message.CREATE_RESOURCE_ENTRY_FAILED, resourceType)); Assert.That(error.Code, Is.EqualTo(expectedCode), Enums.Message.WRONG_ERROR_CODE); }
public void TestUpdateSingleItem(ResourceType resourceType, string fieldName, string fieldValue, int expectedCode) { var phase = new Phase { Id = phaseEntryReader.Data[$"{resourceType.ToPrivateEnum()}{0}"].First().Id }; phase.DictionaryValues[fieldName] = fieldValue; var error = PhaseHelper.WritePhaseFail(phase); Assert.That(error, MustBe.MatchingErrorCode(expectedCode), Enums.Message.WRONG_ERROR_CODE); }
public void TestCreateSingleItem(Enums.ResourceType resourceType, InvalidPhaseOption valueType, int expectedCode) { object fieldValue = GetOptionValue(valueType, resourceType); Phase phase = PhaseHelper.CreatePhaseInstance(creatingRecords, resourceType); phase.PhaseObject = fieldValue; var error = PhaseHelper.WritePhaseFail(phase); Assert.That(error, Is.Not.Null, string.Format(Enums.Message.CREATE_RESOURCE_ENTRY_FAILED, resourceType)); Assert.That(error.Code, Is.EqualTo(expectedCode), Enums.Message.WRONG_ERROR_CODE); }
public void TestUpdateSingleItem(Enums.ResourceType resourceType, string fieldName, WriteInvalidInput valueType, int expectedCode) { string fieldValue = FieldValueMapper.InvalidMapper[valueType]; var phase = new Phase { Id = ReadPhaseBasedOnResource(resourceType, 0) }; phase.DictionaryValues[fieldName] = fieldValue; var error = PhaseHelper.WritePhaseFail(phase); Assert.That(error, MustBe.MatchingErrorCode(expectedCode), Enums.Message.WRONG_ERROR_CODE); }
public void TestUpdateSingleItem(Enums.ResourceType resourceType, InvalidPhaseOption valueType, int expectedCode) { object fieldValue = GetOptionValue(valueType, resourceType); var phase = new Phase { Id = ReadPhaseBasedOnResource(resourceType, 0), Date = Util.ToString(DateTime.Now) }; phase.PhaseObject = fieldValue; var error = PhaseHelper.WritePhaseFail(phase); Assert.That(error, MustBe.MatchingErrorCode(expectedCode), Enums.Message.WRONG_ERROR_CODE); }