Exemple #1
0
            public void Should_Proxy_Call_To_SvnClient()
            {
                // Given
                var fixture = new SvnUpdaterFixture();

                // When
                fixture.UpdateFile();

                // Then
                fixture.SvnClient.Received(1).Update(fixture.FilePath.ToString(), fixture.Settings);
            }
Exemple #2
0
            public void Should_Throw_If_Settings_Is_Null()
            {
                // Given
                var fixture = new SvnUpdaterFixture
                {
                    Settings = null
                };

                // When
                // Then
                Assert.Throws <ArgumentNullException>("settings", () => fixture.UpdateFile());
            }
Exemple #3
0
            public void Should_Throw_If_Revision_Less_Than_Zero()
            {
                // Given
                var fixture = new SvnUpdaterFixture
                {
                    Settings = new SvnUpdateSettings {
                        Revision = -1
                    }
                };

                // When
                // Then
                Assert.Throws <ArgumentException>("settings", () => fixture.UpdateFile());
            }
Exemple #4
0
            public void Should_Not_Force_Credentials_If_Null()
            {
                // Given
                var fixture = new SvnUpdaterFixture
                {
                    Settings = new SvnUpdateSettings
                    {
                        Credentials = null
                    }
                };

                // When
                fixture.UpdateFile();

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

                var fixture = new SvnUpdaterFixture
                {
                    Settings = new SvnUpdateSettings
                    {
                        Credentials = credentials
                    }
                };

                // When
                fixture.UpdateFile();

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