Exemplo n.º 1
0
        public async Task SetUp()
        {
            var p1 = new Participant {
                Name = "Tester 1"
            };
            var p2 = new Participant {
                Name = "Tester 2"
            };

            var retro = new Retrospective {
                FacilitatorHashedPassphrase = "whatever",
                CurrentStage = RetrospectiveStage.Voting,
                Title        = this.GetType().FullName,
                Participants = { p1, p2 },
                Options      =
                {
                    MaximumNumberOfVotes = 3
                }
            };

            this._retroId = retro.UrlId.StringId;
            this.Context.Retrospectives.Add(retro);

            Note note1 = this.Context.Notes.Add(new Note {
                Retrospective = retro,
                Participant   = p1,
                Lane          = this.Context.NoteLanes.FirstOrDefault(),
                Text          = "Test 1"
            }).Entity;
            Note note2 = this.Context.Notes.Add(new Note {
                Retrospective = retro,
                Participant   = p1,
                Lane          = this.Context.NoteLanes.FirstOrDefault(),
                Text          = "Test 2"
            }).Entity;

            var noteGroup1 = new NoteGroup {
                Title         = "Group",
                Retrospective = retro,
                Lane          = this.Context.NoteLanes.FirstOrDefault()
            };

            this.Context.NoteGroups.Add(noteGroup1);
            this.Context.Notes.Add(new Note {
                Retrospective = retro,
                Participant   = p2,
                Group         = noteGroup1,
                Lane          = this.Context.NoteLanes.FirstOrDefault(),
                Text          = "Test 3"
            });

            await this.Context.SaveChangesAsync();

            this.Context.NoteVotes.Add(new NoteVote {
                Note          = note1,
                Participant   = p1,
                Retrospective = retro
            });
            this.Context.NoteVotes.Add(new NoteVote {
                Note          = note1,
                Participant   = p1,
                Retrospective = retro
            });
            this.Context.NoteVotes.Add(new NoteVote {
                Note          = note2,
                Participant   = p1,
                Retrospective = retro
            });
            this.Context.NoteVotes.Add(new NoteVote {
                Note          = note2,
                Participant   = p2,
                Retrospective = retro
            });
            this.Context.NoteVotes.Add(new NoteVote {
                NoteGroup     = noteGroup1,
                Participant   = p2,
                Retrospective = retro
            });

            await this.Context.SaveChangesAsync();

            this._note1Id        = note1.Id;
            this._note2Id        = note2.Id;
            this._noteGroupId    = noteGroup1.Id;
            this._participant1Id = p1.Id;
            this._participant2Id = p2.Id;

            // We have now:
            // - A retrospective
            // - Two notes from p1
            // - One note in a group from p2
            // Note 1 has two votes from p1
            // Note 2 has note group has vote from p2
            // Note 2 has vote from p1
        }
Exemplo n.º 2
0
 private void AssignNoteGroupValues(SerializedProperty groupProp, NoteGroup noteGroup)
 {
     groupProp.FindPropertyRelative(groupNotesName).intValue   = noteGroup.NoteBits;
     groupProp.FindPropertyRelative(relativeTimeName).intValue = noteGroup.GetRelativeTime;
     groupProp.FindPropertyRelative(durationName).intValue     = noteGroup.GetDuration;
 }
Exemplo n.º 3
0
 public LongNoteInfo(NoteGroup noteGroup, int groupIndex)
 {
     this.startStep  = noteGroup.Substep;
     this.duration   = noteGroup.GetDuration;
     this.groupIndex = groupIndex;
 }