public void ToString_WhenCalled_Verify() { // Arrange Act Result = new PhoneDataAccess().ToString(); // Assert Result.ShouldBe("TestNinja.Fundamentals.PhoneDataAccess"); }
public void Delete(IList <Phone> phones) { if (!(BaseSecurity.IsDistrictAdmin(Context))) { throw new ChalkableSecurityException(); } using (var uow = Update()) { var da = new PhoneDataAccess(uow); da.Delete(phones); uow.Commit(); } }
public void SetUp() { Context = ShimsContext.Create(); Instance = new PhoneDataAccess(); ConnectionOpen = false; ConnectionClosed = false; ExecuteScalar = false; Disposed = 0; Records = new List <IStructuralComparable>(); Action = null; SetupFakes(); }
public Phone Edit(string digitOnlyValue, int personId, string value, PhoneType type, bool isPrimary) { if (!(BaseSecurity.IsDistrictAdmin(Context))) { throw new ChalkableSecurityException(); } using (var uow = Update()) { var da = new PhoneDataAccess(uow); var phone = da.GetPhone(personId, digitOnlyValue); phone.DigitOnlyValue = DigitsOnly(value); phone.Value = value; phone.IsPrimary = isPrimary; phone.Type = type; da.Update(phone, new AndQueryCondition { { Phone.DIGIT_ONLY_VALUE_FIELD, digitOnlyValue }, { Phone.PERSON_REF_FIELD, personId } }); uow.Commit(); return(phone); } }