public void Assure_note_with_null_description_returns_empty_string() { Given("a new retrospective note with null description is created", () => _note = new RetrospectiveNote { Description = null }); When("we fetch the description", () => _description = _note.Description); Then("description should be empty string", () => _description.ShouldBe(string.Empty)); }
public void Assure_a_retrospective_note_can_be_saved() { Given("Given a retrospective note is created", () => retrospectiveNote = new RetrospectiveNote()); When("The retrospective note is saved by the webservice", () => client.Save(new RetrospectiveNote[] { retrospectiveNote })); Then("Then there should be one more retrospective note in the repository", () => client.Get(new AllSpecification<RetrospectiveNote>()).ShouldNotBeNull()); }
public void Assure_the_default_type_of_a_note_is_positive() { Given("a new retrospective note is created", () => _note = new RetrospectiveNote()); When("we fetch the type of the note", () => _type = _note.Type); Then("the note should be positive", () => _type.ShouldBe(NoteType.Positive)); }
public void Assure_positive_specification_is_not_satisfied_by_negative_note() { Scenario.StartNew(this, scenario => { scenario.Given("Negative retrospective note is created", () => note = new RetrospectiveNote { Type = NoteType.Negative }); scenario.When("A retrospective positive note specification is used", () => specification = new RetrospectivePositiveNoteSpecification()); scenario.Then("The specification should not be satisfied by the note", () => specification.IsSatisfiedBy(note).ShouldBeFalse()); }); }
public void Assure_it_should_not_be_satisfied_by_an_unequal_description() { Scenario.StartNew(this, scenario => { scenario.Given("A retrospective note with description 'Det gikk bra' is created", () => retrospectiveNote = new RetrospectiveNote { Description = "Det gikk bra" }); scenario.When("A retrospective note by description specification is used with the description 'tull'", () => specification = new RetrospectiveNoteByDescriptionSpecification("tull")); scenario.Then("The specification should be false for the retrospective ntoe", () => specification.IsSatisfiedBy(retrospectiveNote).ShouldBeFalse()); }); }
public void Assure_a_retrospective_note_can_be_deleted_from_the_repository_using_the_webservice() { retrospectiveNote = new RetrospectiveNote {Description = "test"}; client.Save(new RetrospectiveNote[] {retrospectiveNote}); var resultSize = client.Get(new AllSpecification<RetrospectiveNote>()).Length; client.Delete(new RetrospectiveNoteByDescriptionSpecification("test")); Assert.AreEqual(resultSize-1, client.Get(new AllSpecification<RetrospectiveNote>()).Length); }
public void Assure_a_retrospective_note_can_be_deleted_by_using_delete_all_positive_notes_specification() { client.Delete(new AllSpecification<RetrospectiveNote>()); for (int i = 0; i < 5; i++) { retrospectiveNote = new RetrospectiveNote {Description = i.ToString(), Type = NoteType.Positive }; client.Save(new RetrospectiveNote[] { retrospectiveNote }); } client.Delete(new RetrospectivePositiveNoteSpecification()); Assert.AreEqual(0, client.Get(new AllSpecification<RetrospectiveNote>()).Length); }
public void Assure_a_retrospective_note_should_be_sent_through_the_webservice_and_retrieved_afterwards() { Given("A Retrospective Note with description 'Andreas' is created", () => retrospectiveNote = new RetrospectiveNote { Description = "Andreas" }) .And("The repository is empty", () => client.Delete(new AllSpecification<RetrospectiveNote>())) .And("The note is saved using the webservice client", () => client.Save(new RetrospectiveNote[] { retrospectiveNote })); When("When the note is retrieved using the same webservice", () => result = client.Get(new AllSpecification<RetrospectiveNote>())); Then("The note description should be Andreas", () => result[0].Description.ShouldBe("Andreas")); }
private static bool CanFillOldNote(RetrospectiveNote note, int positiveViewModelBuffer, NoteType type) { return positiveViewModelBuffer > 0 && note.Type == type; }
private void FillOldNegativeNote(RetrospectiveNote note, int negativeViewModelBuffer) { var nextOldNoteToFill = _settingsViewModel.NegativeNotes.Count - negativeViewModelBuffer; _uiInvoker.Invoke( () => { _settingsViewModel.NegativeNotes[nextOldNoteToFill].Description = note.Description; UpdateViewModelFromSettingsViewModel(); }); }
private void AddNewNote(RetrospectiveNote note) { _uiInvoker.Invoke(() => { _viewModel.AddNote(new NoteViewModel {Description = note.Description, Type = note.Type}); _settingsViewModel.AddNote(new NoteViewModel{Description = note.Description, Type = note.Type}); }); }
private static IEnumerable<RetrospectiveNote> MockWithTwoCorrectIdAndTwoWrong() { var notes = new RetrospectiveNote[4]; for (int i = 0; i < 2; i++) { notes[i] = new RetrospectiveNote {Description = "Correct ID" + i, Type = NoteType.Positive, Id = _standardConfig.Id.ToString()}; notes[2 + i] = new RetrospectiveNote {Description = "Wrong ID " + i, Type = NoteType.Positive, Id = new Guid().ToString()}; } return notes; }
private static IEnumerable<RetrospectiveNote> MockRetrospectiveNotes(int numberOfNotes) { var notes = new RetrospectiveNote[numberOfNotes*2]; for (int i = 0; i < numberOfNotes; i++ ) { notes[i] = new RetrospectiveNote {Description = "This is positive " + i, Type = NoteType.Positive, Id = _standardConfig.Id.ToString()}; notes[numberOfNotes + i] = new RetrospectiveNote { Description = "This is negative " + i, Type = NoteType.Negative, Id = _standardConfig.Id.ToString() }; } return notes; }