示例#1
0
        public void AttachToSession_ShouldReturnRight_WhenIdIsValid()
        {
            var entry = new Entry("hello", null, null, _clock);

            _dbContext.Entries.Add(entry);
            _dbContext.SaveChanges();
            var session = _sut.NewSession();

            var result = _sut.AttachToSession(entry, session.Id);

            result.IsRight.Should().BeTrue();
            entry.Session.Should().NotBeNull();
            _dbContext.Sessions.Find(session.Id).Entries.Should().NotBeEmpty();
        }