public void MefParametersDTO_Constructor_CorrectInitialValues__SomeValue() { var expected = new Uri("http://example.org"); var configMock = new StubIConfig().BoxUrl_Get(() => expected); var target = new MefParametersDTO(configMock); var actual = target.BoxUrl; Assert.AreEqual(expected, actual); }
public void MefParametersDTO_EventSubscription__SomeValue() { var url1 = new Uri("http://www.heute.de"); var configMock = new StubIConfig().BoxUrl_Get(() => url1); var target = new MefParametersDTO(configMock); var expectedUrl = new Uri("http://www.sportschau.de"); configMock.BoxUrl_Get(() => expectedUrl, overwrite: true); configMock.PropertyChanged_Raise(null); Assert.AreEqual(expectedUrl, target.BoxUrl); }
public void MefParametersDTO_EventSubscription__OtherValue() { var url1 = new Uri("https://outlook.com"); var configMock = new StubIConfig().BoxUrl_Get(() => url1); var target = new MefParametersDTO(configMock); var expectedUrl = new Uri("ftp://localhost/"); configMock.BoxUrl_Get(() => expectedUrl, overwrite: true); configMock.PropertyChanged_Raise(configMock); Assert.AreEqual(expectedUrl, target.BoxUrl); }
public static IConfig CreateConfigMockWithRandomCredentials() { var randomUrl = XeRandom.CreateString(); var randomPassword = XeRandom.CreateString(); var randomUsername = XeRandom.CreateString(); var configMock = new StubIConfig() .BoxUrlAsString_Get(() => randomUrl) .Password_Get(() => randomPassword) .Username_Get(() => randomUsername); return(configMock); }