Example #1
0
        public async Task GetProjectName_UnKnownTagId_ShouldReturnNull()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                // Arrange
                var dut = new TagHelper(context);

                // Act
                var projectName = await dut.GetProjectNameAsync(0);

                // Assert
                Assert.IsNull(projectName);
            }
        }
Example #2
0
        public async Task GetProjectName_KnownTagId_ShouldReturnProjectName()
        {
            using (var context = new PreservationContext(_dbContextOptions, _plantProvider, _eventDispatcher, _currentUserProvider))
            {
                // Arrange
                var dut = new TagHelper(context);

                // Act
                var projectName = await dut.GetProjectNameAsync(_testDataSet.Project1.Tags.First().Id);

                // Assert
                Assert.AreEqual(_testDataSet.Project1.Name, projectName);
            }
        }