public void GetConnectionStringBandCamsStorageTest() { // arrange const string expected = "TestConnectionString"; var configurationSectionStub = new Mock <IConfigurationSection>(); configurationSectionStub.Setup(x => x[It.IsAny <string>()]).Returns(expected); var configurationStub = new Mock <IConfiguration>(); configurationStub.Setup(x => x.GetSection(It.IsAny <string>())).Returns(configurationSectionStub.Object); var configProvider = new ConfigProvider(configurationStub.Object); // act var actual = configProvider.GetConnectionString(Application.BandCamsStorage); // assert StringAssert.AreEqualIgnoringCase(expected, actual); }