Пример #1
0
        public void MeasurementsRepository_Create_CreatesNewMeasurement()
        {
            // arrange isolation

            // arrange test
            var expected = new Measurement
            {
                Attribute     = MeasuredAttribute.Glucose,
                Subject       = Ken,
                Timestamp     = Clock.Now,
                UnitOfMeasure = UnitOfMeasure.mgdL,
                Amount        = 150M,
            };

            // act
            var actual = measurements.Create(expected);

            // assert
            actual.Id.ShouldBeGreaterThan(0);
            ObjectApprover.VerifyWithJson(actual);

            // clean-up
            measurements.Delete(actual.Id);
        }