Beispiel #1
0
            public void Should_Throw_If_SignTool_Cannot_Be_Resolved()
            {
                // Given
                var fixture = new SignToolResolverFixture();

                // When
                var result = Record.Exception(() => fixture.Resolve());

                // Then
                AssertEx.IsCakeException(result, "Failed to find signtool.exe.");
            }
Beispiel #2
0
            public void Should_Return_From_Registry_If_Windows_Kits_Found(bool is64Bit)
            {
                // Given
                var fixture = new SignToolResolverFixture(is64Bit);

                fixture.GivenThatToolHasRegistryKeyWindowsKits();

                // When
                var result = fixture.Resolve();

                // Then
                Assert.NotNull(result);
            }
Beispiel #3
0
            public void Should_Return_From_Registry_If_Found()
            {
                // Given
                var fixture = new SignToolResolverFixture();

                fixture.GivenThatToolHasRegistryKeyMicrosoftSdks();

                // When
                var result = fixture.Resolve();

                // Then
                Assert.NotNull(result);
            }
Beispiel #4
0
            public void Should_Return_From_Disc_If_Found(bool is64Bit)
            {
                // Given
                var fixture = new SignToolResolverFixture(is64Bit);

                fixture.GivenThatToolExistInKnownPath();

                // When
                var result = fixture.Resolve();

                // Then
                Assert.NotNull(result);
            }
Beispiel #5
0
            public void Should_Throw_If_Registry_Is_Null()
            {
                // Given
                var fixture = new SignToolResolverFixture();

                fixture.Registry = null;

                // When
                var result = Record.Exception(() => fixture.Resolve());

                // Then
                AssertEx.IsArgumentNullException(result, "registry");
            }
Beispiel #6
0
            public void Should_Throw_If_File_System_Is_Null()
            {
                // Given
                var fixture = new SignToolResolverFixture();

                fixture.FileSystem = null;

                // When
                var result = Record.Exception(() => fixture.Resolve());

                // Then
                AssertEx.IsArgumentNullException(result, "fileSystem");
            }
Beispiel #7
0
            public void Should_Throw_If_Not_Found_On_Disc_And_SDK_Registry_Path_Cannot_Be_Resolved()
            {
                // Given
                var fixture = new SignToolResolverFixture();

                fixture.GivenThatNoSdkRegistryKeyExist();

                // When
                var result = Record.Exception(() => fixture.Resolve());

                // Then
                AssertEx.IsCakeException(result, "Failed to find signtool.exe.");
            }
Beispiel #8
0
            public void Should_Throw_If_Environment_Is_Null()
            {
                // Given
                var fixture = new SignToolResolverFixture();

                fixture.Environment = null;

                // When
                var result = Record.Exception(() => fixture.Resolve());

                // Then
                Assert.IsArgumentNullException(result, "environment");
            }