Exemplo n.º 1
0
        public void Delete()
        {
            _repository.Create(new TimeEntry(222, 333, new DateTime(2008, 08, 01, 12, 00, 01), 24));
            _repository.Create(new TimeEntry(888, 777, new DateTime(2012, 09, 02, 11, 30, 00), 12));
            _repository.Delete(1);
            var remaining = _repository.List();

            Assert.DoesNotContain(new TimeEntry(1, 222, 333, new DateTime(2008, 08, 01, 12, 00, 01), 24), remaining);
            Assert.Contains(new TimeEntry(2, 888, 777, new DateTime(2012, 09, 02, 11, 30, 00), 12), remaining);
            Assert.Equal(1, remaining.Count());
        }
Exemplo n.º 2
0
        public void Delete()
        {
            _repository.Create(new TimeEntry(222, 333, Convert.ToDateTime("01/08/2008 12:00:01"), 24));
            _repository.Create(new TimeEntry(888, 777, Convert.ToDateTime("02/09/2012 11:30:00"), 12));

            _repository.Delete(1);

            var remaining = _repository.List();

            Assert.DoesNotContain(new TimeEntry(1, 222, 333, Convert.ToDateTime("01/08/2008 12:00:01"), 24), remaining);
            Assert.Contains(new TimeEntry(2, 888, 777, Convert.ToDateTime("02/09/2012 11:30:00"), 12), remaining);
            Assert.Equal(1, remaining.Count());
        }
        public void Delete()
        {
            var timeEntry1 = _repository.Create(new TimeEntry(222, 333, new DateTime(2008, 08, 01, 12, 00, 01), 24));
            var timeEntry2 = _repository.Create(new TimeEntry(888, 777, new DateTime(2012, 09, 02, 11, 30, 00), 12));

            _repository.Delete(timeEntry1.Id ?? 0);

            var remaining = _repository.List();

            Assert.DoesNotContain(timeEntry1, remaining);
            Assert.Contains(timeEntry2, remaining);
            Assert.Single(remaining);
        }
Exemplo n.º 4
0
        public void Delete()
        {
            // Arrange
            _repository.Create(new TimeEntry(222, 333, new DateTime(2008, 08, 01, 12, 00, 01), 24));
            _repository.Create(new TimeEntry(888, 777, new DateTime(2012, 09, 02, 11, 30, 00), 12));

            // Act
            _repository.Delete(1);

            // Assert
            var entries = _repository.List();

            entries.Count.Should().Be(1);
            entries[0].Should().BeEquivalentTo(new TimeEntry(2, 888, 777, new DateTime(2012, 09, 02, 11, 30, 00), 12));
        }