public Guid AddSession(IReceiver receiver, IAnalysis analysis)
        {
            var newSession = new Session(receiver, analysis);

            Sessions.Add(newSession);

            return newSession.Id;
        }
Exemplo n.º 2
0
        public void AddNewDiagnoseOutputEntry_Normal_CallsProcessNewDiagnoseOutputEntryFromAnalysis()
        {
            var processNewDiagnoseOutputEntryWasCalled = false;

            var analysisMock = new Mock<IAnalysis>();
            analysisMock.Setup(x => x.ProcessNewDiagnoseOutputEntry(It.IsAny<IDiagnoseOutputEntry>()))
                        .Callback(() => processNewDiagnoseOutputEntryWasCalled = true);

            var receiverMock = new Mock<IReceiver>();

            var session = new Session(receiverMock.Object, analysisMock.Object);

            var diagnoseMock = new Mock<IDiagnoseOutputEntry>();

            session.DiagnoseOutputEntries.Add(diagnoseMock.Object);

            processNewDiagnoseOutputEntryWasCalled.Should().BeTrue();
        }
Exemplo n.º 3
0
        public void Constructor_Normal_CreatsNewGuid()
        {
            var receiverMock = new Mock<IReceiver>();
            var analysisMock = new Mock<IAnalysis>();

            var session = new Session(receiverMock.Object, analysisMock.Object);
            var session2 = new Session(receiverMock.Object, analysisMock.Object);

            session.Id.Should().NotBeEmpty();
            session.Id.Should().NotBe(session2.Id);
        }