示例#1
0
        public void ShouldBeAbleToInitializeOnWindows()
        {
            // Arrange
            // Act
            if (Platform.IsWindows)
            {
                var mysqld = MySqlWindowsServiceFinder.FindPathToMySql();
                Expect(mysqld).Not.To.Be.Null(
                    "Unable to find mysql service via sc command on this platform"
                    );

                Expect(() =>
                {
                    using (new TempDBMySql())
                    {
                    }
                })
                .Not.To.Throw <FatalTempDbInitializationException>();
            }
            else
            {
                Expect(() =>
                {
                    using (new TempDBMySql())
                    {
                    }
                })
                .To.Throw <FatalTempDbInitializationException>();
            }
        }
        public void ShouldBeAbleToFindServiceWhenNotRunning()
        {
            // Arrange
            var svc = new WindowsServiceUtil("mysql57");

            svc.Stop();
            // Act
            var path = MySqlWindowsServiceFinder.FindPathToMySql();

            // Assert
            Expect(path).Not.To.Be.Null.Or.Empty();
        }
示例#3
0
        public void ShouldBeAbleToInitializeOnWindows()
        {
            // Arrange
            // Act
            if (Environment.OSVersion.Platform == PlatformID.Win32NT)
            {
                var mysqld = MySqlWindowsServiceFinder.FindPathToMySql();
                Expect(mysqld).Not.To.Be.Null(
                    "Unable to find mysql service via sc command on this platform"
                    );

                Expect(() => new TempDBMySql())
                .Not.To.Throw <FatalTempDbInitializationException>();
            }
            else
            {
                Expect(() => new TempDBMySql())
                .To.Throw <FatalTempDbInitializationException>();
            }
        }