Пример #1
0
        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.");
        }
Пример #2
0
        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.");
        }
Пример #3
0
        /// <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)
                 ));
        }
Пример #4
0
        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.");
        }
Пример #5
0
        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.");
        }
Пример #6
0
        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.");
        }
Пример #7
0
 public void UpdateNote(NoteId noteId, Action <Item> update)
 {
     foreach (var note in Notes.Where(t => t.NoteId == noteId))
     {
         update(note);
     }
 }
Пример #8
0
 public void AddNote(NoteId noteId, string title, string text)
 {
     Notes.Add(new Item()
     {
         NoteId = noteId,
         Title  = title
     });
 }
Пример #9
0
        public string ToQuery()
        {
            var b = new QueryBuilder();

            b.AddQuery(Routes.Query.FolderId, FolderId.ToString());
            b.AddQuery(Routes.Query.NoteId, NoteId.ToString());
            return(b.Result);
        }
Пример #10
0
        public void ArchiveNote(NoteId noteId)
        {
            var notes = Notes.Where(n => n.NoteId == noteId).ToList();

            foreach (var note in notes)
            {
                Notes.Remove(note);
            }
        }
Пример #11
0
        public async Task <IActionResult> Delete(
            [FromServices] IDeleteNoteUseCase useCase,
            [FromServices] DeleteNotePresenter presenter,
            [FromBody] NoteId input)
        {
            await useCase.Execute(new DeleteNoteInput(input.Id));

            return(presenter.ViewModel);
        }
Пример #12
0
    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);
        }
    }
Пример #13
0
 /// <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);
     }
 }
Пример #14
0
 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;
 }
Пример #16
0
 public EditNote(NoteId noteId, string text, string oldText)
 {
     NoteId = noteId;
     Text = text;
     OldText = oldText;
 }
Пример #17
0
 public NoteAdded(NoteId noteId, string title, string text, StoryId storyId)
 {
     NoteId = noteId;
     Title = title;
     Text = text;
     StoryId = storyId;
 }
Пример #18
0
 public NoteArchived(NoteId noteId, StoryId storyId)
 {
     NoteId = noteId;
     StoryId = storyId;
 }
Пример #19
0
 public NoteEdited(NoteId noteId, string newText, string oldText, StoryId storyId)
 {
     NoteId = noteId;
     NewText = newText;
     OldText = oldText;
     StoryId = storyId;
 }
Пример #20
0
 public NoteRenamed(NoteId noteId, string oldName, string newName, StoryId storyId)
 {
     NoteId = noteId;
     OldName = oldName;
     NewName = newName;
     StoryId = storyId;
 }
Пример #21
0
 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());
 }
Пример #23
0
        public void Equals_SameObject()
        {
            var noteId = new NoteId(new FourBitNumber(), new SevenBitNumber());

            Assert.AreEqual(noteId, noteId, "An object is not equal to itself.");
        }
Пример #24
0
 public PlaybackNotesDictionaryEntry(NoteId noteId, Note note)
 {
     NoteId = noteId;
     Note   = note;
 }
Пример #25
0
 public void Remove(NoteId noteId)
 {
     _notes.Remove(noteId);
 }
Пример #26
0
 public override string ToString() =>
 NoteId.ToString() + " " + Fullname + " " + Telephone;
Пример #27
0
        public void Equals_NullObject()
        {
            var noteId = new NoteId(new FourBitNumber(), new SevenBitNumber());

            Assert.AreNotEqual(noteId, null, "A null and non-null object are equal.");
        }