コード例 #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);
            }
コード例 #2
0
            public void Should_Throw_If_Settings_Is_Null()
            {
                // Given
                var fixture = new SvnUpdaterFixture
                {
                    Settings = null
                };

                // When
                // Then
                Assert.Throws <ArgumentNullException>("settings", () => fixture.UpdateDirectory());
            }
コード例 #3
0
            public void Should_Throw_If_Environment_Is_Null()
            {
                // Given
                var fixture = new SvnUpdaterFixture
                {
                    Environment = null
                };

                // When
                // Then
                Assert.Throws <ArgumentNullException>("environment", () => fixture.CreateUpdater());
            }
コード例 #4
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.UpdateDirectory());
            }
コード例 #5
0
            public void Should_Not_Force_Credentials_If_Null()
            {
                // Given
                var fixture = new SvnUpdaterFixture
                {
                    Settings = new SvnUpdateSettings
                    {
                        Credentials = null
                    }
                };

                // When
                fixture.UpdateDirectory();

                // Then
                fixture.SvnClient.DidNotReceive().ForceCredentials(Arg.Any <SvnCredentials>());
            }
コード例 #6
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.UpdateDirectory();

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