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_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_Force_Credentials_If_Not_Null()
            {
                // Given
                SvnCredentials credentials = new SvnCredentials
                {
                    Username = "******",
                    Password = "******"
                };

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

                // When
                fixture.GetInfo();

                // Then
                fixture.SvnClient.Received(3).ForceCredentials(credentials);
            }