Exemplo n.º 1
0
        public async Task HandleGetDateTimeSettingQueryHandler_UnknownCode_ShouldReturnNotFound()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut    = new GetDateTimeSettingQueryHandler(context);
                var result = await dut.Handle(new GetDateTimeSettingQuery("XYZ"), default);

                Assert.AreEqual(ResultType.NotFound, result.ResultType);
                Assert.IsNull(result.Data);
            }
        }
Exemplo n.º 2
0
        public async Task HandleGetDateTimeSettingQueryHandler_CodeWithoutDate_ShouldReturnNullAsDate()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var dut    = new GetDateTimeSettingQueryHandler(context);
                var result = await dut.Handle(new GetDateTimeSettingQuery(_codeWithoutDate), default);

                Assert.AreEqual(ResultType.Ok, result.ResultType);

                var dt = result.Data;
                Assert.IsFalse(dt.HasValue);
            }
        }