private static int Compare(ProfileStorage actual, ProfileStorage expected) { if (actual.Id != expected.Id) { return(-1); } if (actual.ProfileId != expected.ProfileId) { return(-1); } if (actual.Name != expected.Name) { return(-1); } if (!actual.GetValue().Equals(expected.GetValue())) { return(-1); } return(0); }
public void ShouldDeleteByNameWhenNameContainsSpecialCharacters() { var profileStorage = new ProfileStorage { ProfileId = _profile.Id, ValueKey = "value key", Name = "'test" }; profileStorage.SetValue("my value"); _persister.Insert(profileStorage); _persister.Delete(_profile.Id, new TypeNameWithoutVersion(profileStorage.ValueKey), profileStorage.Name); _persister.Contains(profileStorage.Name, _profile.Id, new TypeNameWithoutVersion(profileStorage.ValueKey), profileStorage.GetValue()).Should( Be.False); }