예제 #1
0
        public void UpsertJob_AddNewUniqueJob()
        {
            // reset database for test
            SqlData.DeleteJob("New Unique Job #1");

            //Arrange
            var newJob = new JobDataModel
            {
                Id     = null,
                Name   = "New Unique Job #1",
                Type   = "Electrical",
                Date   = DateTime.Parse("2018-04-01"),
                Amount = 125.00M
            };

            //Act
            var newId = SqlData.UpsertJob(newJob);

            _outputHelper.WriteLine("[INFO] New job created with Id = {0}",
                                    newId?.ToString() ?? "null");

            //Assert
            Assert.NotNull(newId);
        }