public void DeletePlan_Non_Existent_Plan_Succeeds() { // Arrange Guid planUId = Guid.NewGuid(); DynamoDbDal dal = new DynamoDbDal { PlanTable = _planTable }; // Act // Assert Assert.DoesNotThrow(() => dal.DeletePlan(planUId)); }
public void DeletePlan_Null_Plan_Table_Throws_Exception() { // Arrange Guid planUId = Guid.NewGuid(); DynamoDbDal dal = new DynamoDbDal { PlanTable = "" }; // Act Exception ex = Assert.Throws <Exception>(() => dal.DeletePlan(planUId)); // Assert StringAssert.AreEqualIgnoringCase(ex.Message, "Plan table name must be specified."); }
public void DeletePlan_Non_Existent_Table_Throws_Exception() { // Arrange Guid planUId = Guid.NewGuid(); DynamoDbDal dal = new DynamoDbDal { PlanTable = "XXXXXX" }; // Act Exception ex = Assert.Throws <ResourceNotFoundException>(() => dal.DeletePlan(planUId)); // Assert StringAssert.Contains("Requested resource not found: Table", ex.Message); }
public void DeletePlan_Empty_PlanUId_Throws_Exception() { // Arrange Guid planUId = Guid.Empty; DynamoDbDal dal = new DynamoDbDal { PlanTable = _planTable }; // Act Exception ex = Assert.Throws <Exception>(() => dal.DeletePlan(planUId)); // Assert StringAssert.AreEqualIgnoringCase("Plan unique id cannot be empty.", ex.Message); }
public void DeletePlan_Existing_Plan_Succeeds() { // Arrange Guid planUId = Guid.NewGuid(); PlanItem plan = new PlanItem() { UId = planUId, Name = _planPrefix + planUId, UniqueName = _planPrefix + planUId }; DynamoDbDal dal = new DynamoDbDal { PlanTable = _planTable }; // Act dal.UpsertPlan(plan); Assert.DoesNotThrow(() => dal.DeletePlan(planUId)); }