コード例 #1
0
        public void GetConfigurationWrongIdFail()
        {
            var manager = new ConfigurationManager(UnitTestHelper.FakeRepository.Object,
                UnitTestHelper.FakeAuditor.Object);

            var configuration = manager.GetConfiguration(Guid.NewGuid(), It.IsAny<string>());
            Assert.IsNull(configuration, $"Expected null configuration, found {configuration}");
        }
コード例 #2
0
        public void GetConfigurationCorrectIdPass()
        {
            var manager = new ConfigurationManager(UnitTestHelper.FakeRepository.Object,
                UnitTestHelper.FakeAuditor.Object);

            var configuration = manager.GetConfiguration(FakeRepository.ConfigurationId, It.IsAny<string>());
            Assert.IsNotNull(configuration, "Expected valid configuration, found null");
            Assert.AreEqual(FakeRepository.ConfigurationId, configuration.Id, "Expected configuration Id not found");
            Assert.AreEqual(FakeRepository.UserName, configuration.Author, "Expected configuration name not found");
        }