public void SqlCE_ConnectionString_Is_Parsed()
        {
            // setup
            var setting = new ConnectionStringSettings("umbracoDbDSN", "Data Source=|DataDirectory|\\Umbraco.sdf;Flush Interval=1;", "System.Data.SqlServerCe.4.0");

            _provider = new DatabaseServerFactFamilyProvider(setting);

            // test
            var factFamily = _provider.Build("Some Environment");

            // assert
            Assert.Equal("Database Settings", factFamily.Title);
            Assert.Equal("SqlServerCe", factFamily.Pairs[0].Key);
            Assert.Equal("Data Source=|DataDirectory|\\Umbraco.sdf;Flush Interval=1;", factFamily.Pairs[0].Value);
        }
Example #2
0
        public void Fact_Pairs_Are_Created()
        {
            // setup
            _provider = new ServerInformationFactFamilyProvider(MACHINE_NAME, TICK_COUNT);

            // test
            var factFamily = _provider.Build("Some Environment");

            // assert
            Assert.Equal("Server Information", factFamily.Title);
            Assert.Equal("Machine Name", factFamily.Pairs[0].Key);
            Assert.Equal(MACHINE_NAME, factFamily.Pairs[0].Value);

            Assert.Equal("Uptime", factFamily.Pairs[2].Key);
            Assert.Equal("00:01:40", factFamily.Pairs[2].Value);
        }
        public void SqlServer_ConnectionString_Is_Parsed()
        {
            // setup
            var setting = new ConnectionStringSettings("umbracoDbDSN", "server=ServerAddress;database=DatabaseName;user id=UserId;password='******'", "System.Data.SqlClient");

            _provider = new DatabaseServerFactFamilyProvider(setting);

            // test
            var factFamily = _provider.Build("Some Environment");

            // assert
            Assert.Equal("Database Settings", factFamily.Title);
            Assert.Equal("Server", factFamily.Pairs[0].Key);
            Assert.Equal("ServerAddress", factFamily.Pairs[0].Value);
            Assert.Equal("Database", factFamily.Pairs[1].Key);
            Assert.Equal("DatabaseName", factFamily.Pairs[1].Value);
        }