Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }