public ReportRoot() { _costItems = new List <CostItem>(); var evt = new ReportCreatedEvent(this); AddDomainEvent(evt); }
public IssueListViewModel(IEventAggregator eventAggregator) { this.eventAggregator = eventAggregator; ReportCreatedEvent reportCreatedEvent = eventAggregator.GetEvent <ReportCreatedEvent>(); reportCreatedEvent.Subscribe(OnReportCreated); }
public InvestigateCodeViewModel(ICodeInspectService codeInspectService, IEventAggregator eventAggregator) { this.GetIssuesButtonText = GET_ISSUES_TEXT; this.codeInspectService = codeInspectService; ReportCreatedEvent reportCreatedEvent = eventAggregator.GetEvent <ReportCreatedEvent>(); reportCreatedEvent.Subscribe(OnReportCreated); }
private void OnReportCreated(Report report) { ReportCreatedEvent reportCreatedEvent = eventAggregator.GetEvent <ReportCreatedEvent>(); reportCreatedEvent.Publish(report); //if (this.ReportCreated != null) //{ // this.ReportCreated.Invoke(this, new ReportCreatedEventArgs() { Report = report }); //} }
public void CanBeConstructed() { //Arrange ReportCreatedEvent sut; //Act sut = new ReportCreatedEvent(null); //Assert Assert.NotNull(sut); Assert.True(sut.ReportItem == null); }
public void AreNotEqual() { //Arrange var reportItem = new ReportRoot(); var sut = new ReportCreatedEvent(reportItem); //Act var anotherEvent = new ReportCreatedEvent(reportItem); //Assert Assert.True(sut.ReportItem == reportItem); Assert.True(anotherEvent.ReportItem == reportItem); Assert.False(sut.Equals(anotherEvent)); }