Пример #1
0
        public void CreateInsertsATimeEntryRecord()
        {
            // Arrange
            var newTimeEntry = new TimeEntry(123, 456, DateTime.Parse("2012-01-02"), 12);

            // Act
            var createdTimeEntryId = _repository.Create(newTimeEntry).Id.Value;

            // Assert
            var foundInDb = FindInDb(createdTimeEntryId);

            foundInDb.Count.Should().Be(1);
        }
        public void CreateInsertsATimeEntryRecord()
        {
            var newTimeEntry = new TimeEntry(123, 456, DateTime.Parse("2012-01-02"), 12);

            var createdTimeEntryId = _repository.Create(newTimeEntry).Id.Value;

            var foundInDb = FindInDb(createdTimeEntryId);

            Assert.Equal(createdTimeEntryId, foundInDb[0]["id"]);
            Assert.Equal(newTimeEntry.ProjectId, foundInDb[0]["project_id"]);
            Assert.Equal(newTimeEntry.UserId, foundInDb[0]["user_id"]);
            Assert.Equal(newTimeEntry.Date, foundInDb[0]["date"]);
            Assert.Equal(newTimeEntry.Hours, foundInDb[0]["hours"]);

            Assert.Equal(1, foundInDb.Count);
        }