Ejemplo n.º 1
0
        public async Task ExistsAndIsVoidedAsync_UnknownCode_ShouldReturnFalse()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher,
                                                         _currentUserProvider))
            {
                var dut    = new ResponsibleValidator(context);
                var result = await dut.ExistsAndIsVoidedAsync("A", default);

                Assert.IsFalse(result);
            }
        }
Ejemplo n.º 2
0
        public async Task ExistsAndIsVoidedAsync_KnownCode_Voided_ShouldReturnTrue()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                var responsible = context.Responsibles.Single(r => r.Code == _responsibleCode);
                responsible.IsVoided = true;
                context.SaveChangesAsync().Wait();
            }

            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher,
                                                         _currentUserProvider))
            {
                var dut    = new ResponsibleValidator(context);
                var result = await dut.ExistsAndIsVoidedAsync(_responsibleCode, default);

                Assert.IsTrue(result);
            }
        }