public void Should_NotThrow_If_Parameters_AreSet()
            {
                // Given
                var fixture = new SvnInfoFixture();

                // When
                fixture.CreateInfo();
            }
            public void Should_Not_Throw_If_Settings_Is_Null()
            {
                // Given
                var fixture = new SvnInfoFixture
                {
                    Settings = null
                };

                // When
                fixture.IsWorkingCopy();
            }
            public void Should_Throw_If_RepositoryUri_Is_File()
            {
                // Given
                var fixture = new SvnInfoFixture
                {
                    RepositoryUri = new Uri(@"C:\project\src\file.cs")
                };

                // Then
                Assert.Throws <ArgumentException>("repositoryUrl", () => fixture.GetInfo());
            }
            public void Should_Throw_If_FileOrDirectoryPath_Is_Null()
            {
                // Given
                var fixture = new SvnInfoFixture
                {
                    RepositoryUri = null
                };

                // When
                // Then
                Assert.Throws <ArgumentNullException>("repositoryUrl", () => fixture.GetInfo());
            }
            public void Should_Throw_If_Settings_Is_Null()
            {
                // Given
                var fixture = new SvnInfoFixture
                {
                    Settings = null
                };

                // When
                // Then
                Assert.Throws <ArgumentNullException>("settings", () => fixture.GetInfo());
            }
            public void Should_Throw_If_GetSvnClient_Is_Null()
            {
                // Given
                var fixture = new SvnInfoFixture
                {
                    GetSvnClient = null
                };

                // When
                // Then
                Assert.Throws <ArgumentNullException>("clientFactoryMethod", () => fixture.CreateInfo());
            }
            public void Should_Throw_If_Environment_Is_Null()
            {
                // Given
                var fixture = new SvnInfoFixture
                {
                    Environment = null
                };

                // When
                // Then
                Assert.Throws <ArgumentNullException>("environment", () => fixture.CreateInfo());
            }
            public void Should_Proxy_Call_To_GetInfo_OnSvnClient()
            {
                // Given
                var fixture = new SvnInfoFixture();

                // When
                fixture.IsWorkingCopy();

                // Then
                fixture.SvnClient.Received(1).IsWorkingCopy(fixture.DirectoryPath.ToString());
                fixture.SvnClient.Received(1).IsWorkingCopy(fixture.FilePath.ToString());
            }
            public void Should_Throw_If_FilePath_Is_Null()
            {
                // Given
                var fixture = new SvnInfoFixture
                {
                    FilePath = null
                };

                // When
                // Then
                Assert.Throws <ArgumentNullException>("filePath", () => fixture.IsWorkingCopy());
            }
            public void Should_Proxy_Call_To_GetInfo_OnSvnClient()
            {
                // Given
                var fixture = new SvnInfoFixture();

                // When
                fixture.GetInfo();

                // Then
                fixture.SvnClient.Received(1).GetInfo(fixture.RepositoryUri.ToString(), fixture.Settings);
                fixture.SvnClient.Received(1).GetInfo(fixture.DirectoryPath.ToString(), fixture.Settings);
                fixture.SvnClient.Received(1).GetInfo(fixture.FilePath.ToString(), fixture.Settings);
            }
            public void Should_Not_Force_Credentials_If_Null()
            {
                // Given
                var fixture = new SvnInfoFixture
                {
                    Settings = new SvnInfoSettings
                    {
                        Credentials = null
                    }
                };

                // When
                fixture.GetInfo();

                // Then
                fixture.SvnClient.DidNotReceive().ForceCredentials(Arg.Any <SvnCredentials>());
            }
            public void Should_Not_Force_Credentials_If_Not_Null()
            {
                // Given
                SvnCredentials credentials = new SvnCredentials
                {
                    Username = "******",
                    Password = "******"
                };

                var fixture = new SvnInfoFixture
                {
                    Settings = new SvnInfoSettings
                    {
                        Credentials = credentials
                    }
                };

                // When
                fixture.IsWorkingCopy();

                // Then
                fixture.SvnClient.DidNotReceive().ForceCredentials(credentials);
            }