// not virtual as is called from the ctor protected void OnOpening(Guid id, Solution solution, AppVersion version, Build build, string title, string description, string stepsToReproduce, string expectedResult, string actualResult, DateTimeOffset opened) { DomainEventHandler<IssueOpened> handler = Opening; if (handler != null) handler(this, new DomainEventEventArgs<IssueOpened>( new IssueOpened(id) { Solution = solution, Version = version, Build = build, Title = title, Description = description, StepsToReproduce = stepsToReproduce, ExpectedResult = expectedResult, ActualResult = actualResult, Opened = opened }, doOpen)); }
public void OpenHandler_WhenEventApplied_SetsAllValues() { var solution = new Solution(Guid.Empty, "solution"); var version = new AppVersion(Guid.Empty, "version"); var build = new Build(Guid.Empty, "build"); string title = "title", description = "description", steps = "steps", expected = "expected", actual = "actual"; OpenIssue.Opening += EventApplier; DateTimeOffset now = 12.November(2011).At(t => t.MidNight).In(TimeSpan.Zero); OpenIssue open = null; HappeningIn(now, () => { open = Issue.Open(solution, version, build, title, description, steps, expected, actual); }); Assert.That(open.Solution, Is.SameAs(solution)); Assert.That(open.Version, Is.SameAs(version)); Assert.That(open.Build, Is.SameAs(build)); Assert.That(open.Title, Is.EqualTo(title)); Assert.That(open.Description, Is.EqualTo(description)); Assert.That(open.StepsToReproduce, Is.EqualTo(steps)); Assert.That(open.ExpectedResult, Is.EqualTo(expected)); Assert.That(open.ActualResult, Is.EqualTo(actual)); Assert.That(open.Opened, Is.EqualTo(now)); }
protected Issue(Guid id, Solution solution, AppVersion version, Build build, string title, string description) { Id = id; Solution = solution; Version = version; Build = build; Title = title; Description = description; }
public void Open_RaisesEvent() { var solution = new Solution(Guid.Empty, "solution"); var version = new AppVersion(Guid.Empty, "version"); var build = new Build(Guid.Empty, "build"); string title = "title", description = "description", steps = "steps", expected = "expected", actual = "actual"; bool raised = false; OpenIssue.Opening += (sender, e) => { raised = true; }; Issue.Open(solution, version, build, title, description, steps, expected, actual); Assert.That(raised, Is.True); }
protected internal OpenIssue(Solution solution, AppVersion version, Build build, string title, string description, string stepsToReproduce, string expectedResult, string actualResult) : base(solution, version, build, title, description) { OnOpening(Comb.Generate(), solution, version, build, title, description, stepsToReproduce, expectedResult, actualResult, Time.UtcNow); }
protected Issue(Solution solution, AppVersion version, Build build, string title, string description) : this(Comb.Generate(), solution, version, build, title, description) { }
public static OpenIssue Open(Solution solution, AppVersion version, Build build, string title, string description, string stepsToReproduce, string expectedResult, string actualResult) { return new OpenIssue(solution, version, build, title, description, stepsToReproduce, expectedResult, actualResult); }