public void AddTest() { VerifyDoesntExist(); bool value = MaintanceDetails.Add(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, _maintenanceDetailsRoundsFired, _maintenanceDetailsNotes, "N/A", _maintenanceDetailsBarrelSystemId, _maintenanceDetailsDoesCount, out _errOut); General.HasTrueValue(value, _errOut); }
/// <summary> /// Verifies the exists. /// </summary> private void VerifyExists() { if (!MaintanceDetails.Exists(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, out _errOut)) { MaintanceDetails.Add(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, _maintenanceDetailsRoundsFired, _maintenanceDetailsNotes, "N/A", _maintenanceDetailsBarrelSystemId, _maintenanceDetailsDoesCount, out _errOut); } }
public void ListFromGunTest() { VerifyExists(); List <MaintanceDetailsList> value = MaintanceDetails.Lists(_databasePath, _gunId, out _errOut); PrintList(value); General.HasTrueValue(value.Count > 0, _errOut); }
public void GetIdTest() { VerifyExists(); long id = MaintanceDetails.GetId(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, out _errOut); TestContext.WriteLine($"id: {id}"); General.HasTrueValue(id > 0, _errOut); }
public void DeleteTest() { VerifyExists(); long id = MaintanceDetails.GetId(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, out _errOut); bool value = MaintanceDetails.Delete(_databasePath, id, out _errOut); General.HasTrueValue(value, _errOut); }
/// <summary> /// Verifies the doesnt exist. /// </summary> private void VerifyDoesntExist() { if (MaintanceDetails.Exists(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, out _errOut)) { long value = MaintanceDetails.GetId(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, out _errOut); MaintanceDetails.Delete(_databasePath, value, out _errOut); } }
public void GetNameTest() { VerifyExists(); long id = MaintanceDetails.GetId(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, out _errOut); string name = MaintanceDetails.GetName(_databasePath, id, out _errOut); TestContext.WriteLine($"Name: {name}"); General.HasTrueValue(name.Length > 0, _errOut); }
public void ExistsTest() { VerifyExists(); bool value = MaintanceDetails.Exists(_databasePath, _maintenanceDetailsName, _gunId, _maintenanceDetailsPlanId, _maintenanceDetailsOperationDate, _maintenanceDetailsOperationDueDate, out _errOut); General.HasTrueValue(value, _errOut); }