Пример #1
0
        public async Task GetResponsibleCode_UnKnownTagId_ShouldReturnNull()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                // Arrange
                var dut = new TagHelper(context);

                // Act
                var responsibleCode = await dut.GetResponsibleCodeAsync(0);

                // Assert
                Assert.IsNull(responsibleCode);
            }
        }
Пример #2
0
        public async Task GetResponsibleCode_KnownTagId_ShouldReturnResponsibleCode()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                // Arrange
                var dut = new TagHelper(context);

                // Act
                var responsibleCode = await dut.GetResponsibleCodeAsync(_testDataSet.Project1.Tags.First().Id);

                // Assert
                Assert.AreEqual(_testDataSet.Responsible1.Code, responsibleCode);
            }
        }