public void Equals_SameValues() { var noteId1 = new NoteId(new FourBitNumber(1), new SevenBitNumber(2)); var noteId2 = new NoteId(new FourBitNumber(1), new SevenBitNumber(2)); Assert.AreEqual(noteId1, noteId2, "Identical objects are not equal."); }
public void Equals_DifferentObjectType() { var noteId1 = new NoteId(new FourBitNumber(), new SevenBitNumber()); var noteId2 = new object(); Assert.AreNotEqual(noteId1, noteId2, "Objects of different types are equal."); }
/// <summary> /// Returns true if DutyTempStaffingNoteCreatedEvent instances are equal /// </summary> /// <param name="other">Instance of DutyTempStaffingNoteCreatedEvent to be compared</param> /// <returns>Boolean</returns> public bool Equals(DutyTempStaffingNoteCreatedEvent other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( DutyId == other.DutyId || DutyId != null && DutyId.Equals(other.DutyId) ) && ( NoteId == other.NoteId || NoteId != null && NoteId.Equals(other.NoteId) ) && ( Content == other.Content || Content != null && Content.Equals(other.Content) )); }
public void Equals_DifferentNoteNumberValues() { var noteId1 = new NoteId(new FourBitNumber(1), new SevenBitNumber(2)); var noteId2 = new NoteId(new FourBitNumber(1), new SevenBitNumber(3)); Assert.AreNotEqual(noteId1, noteId2, "Objects with mismatched note number values are equal."); }
public void GetHashCode_Different() { var noteId1 = new NoteId(new FourBitNumber(1), new SevenBitNumber(2)); var noteId2 = new NoteId(new FourBitNumber(2), new SevenBitNumber(1)); Assert.AreNotEqual(noteId1.GetHashCode(), noteId2.GetHashCode(), "Hash codes for different objects are the same."); }
public void GetHashCode_Same() { var noteId1 = new NoteId(new FourBitNumber(1), new SevenBitNumber(2)); var noteId2 = new NoteId(new FourBitNumber(1), new SevenBitNumber(2)); Assert.AreEqual(noteId1.GetHashCode(), noteId2.GetHashCode(), "Hash codes for identical objects are different."); }
public void UpdateNote(NoteId noteId, Action <Item> update) { foreach (var note in Notes.Where(t => t.NoteId == noteId)) { update(note); } }
public void AddNote(NoteId noteId, string title, string text) { Notes.Add(new Item() { NoteId = noteId, Title = title }); }
public string ToQuery() { var b = new QueryBuilder(); b.AddQuery(Routes.Query.FolderId, FolderId.ToString()); b.AddQuery(Routes.Query.NoteId, NoteId.ToString()); return(b.Result); }
public void ArchiveNote(NoteId noteId) { var notes = Notes.Where(n => n.NoteId == noteId).ToList(); foreach (var note in notes) { Notes.Remove(note); } }
public async Task <IActionResult> Delete( [FromServices] IDeleteNoteUseCase useCase, [FromServices] DeleteNotePresenter presenter, [FromBody] NoteId input) { await useCase.Execute(new DeleteNoteInput(input.Id)); return(presenter.ViewModel); }
public ClassicNoteRenderer(Note note) : base(note) { UseExperimentalAnimations = Context.Player.Settings.UseExperimentalNoteAnimations; Ring = Note.transform.Find("NoteRing").GetComponent <SpriteRenderer>(); Fill = Note.transform.Find("NoteFill").GetComponent <SpriteRenderer>(); Ring.enabled = false; Fill.enabled = false; // Generate note ID if (Game.Config.DisplayNoteIds || Game is PlayerGame) { DisplayNoteId = true; NoteId = Object.Instantiate(GameObjectProvider.Instance.noteIdPrefab, Note.transform); NoteId.Visible = Game.Config.DisplayNoteIds || (Game is PlayerGame playerGame && !playerGame.HideInterface); NoteId.gameObject.SetActive(false); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (DutyId != null) { hashCode = hashCode * 59 + DutyId.GetHashCode(); } if (NoteId != null) { hashCode = hashCode * 59 + NoteId.GetHashCode(); } if (Content != null) { hashCode = hashCode * 59 + Content.GetHashCode(); } return(hashCode); } }
public void AddOrUpdate(NoteId noteId, Note note) { _notes[noteId] = note; }
public NoteItem(string title, string text, NoteId id, StoryId story) : base(story) { Title = title; Text = text; Id = id; }
public EditNote(NoteId noteId, string text, string oldText) { NoteId = noteId; Text = text; OldText = oldText; }
public NoteAdded(NoteId noteId, string title, string text, StoryId storyId) { NoteId = noteId; Title = title; Text = text; StoryId = storyId; }
public NoteArchived(NoteId noteId, StoryId storyId) { NoteId = noteId; StoryId = storyId; }
public NoteEdited(NoteId noteId, string newText, string oldText, StoryId storyId) { NoteId = noteId; NewText = newText; OldText = oldText; StoryId = storyId; }
public NoteRenamed(NoteId noteId, string oldName, string newName, StoryId storyId) { NoteId = noteId; OldName = oldName; NewName = newName; StoryId = storyId; }
public override string ToString() { return(NoteId.ToString()); }
/// <summary> /// Override of <see cref="object.GetHashCode" />. /// </summary> /// <returns>Returns the result of calling <see cref="object.GetHashCode" /> on the <see cref="NoteId" /> property.</returns> public override int GetHashCode() { return(NoteId.GetHashCode()); }
public void Equals_SameObject() { var noteId = new NoteId(new FourBitNumber(), new SevenBitNumber()); Assert.AreEqual(noteId, noteId, "An object is not equal to itself."); }
public PlaybackNotesDictionaryEntry(NoteId noteId, Note note) { NoteId = noteId; Note = note; }
public void Remove(NoteId noteId) { _notes.Remove(noteId); }
public override string ToString() => NoteId.ToString() + " " + Fullname + " " + Telephone;
public void Equals_NullObject() { var noteId = new NoteId(new FourBitNumber(), new SevenBitNumber()); Assert.AreNotEqual(noteId, null, "A null and non-null object are equal."); }