コード例 #1
0
        public void ShouldThrowIfAppPackagerCannotBeResolved()
        {
            // Given
            var fixture = new AppPackagerResolverFixture();

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

            // Then
            result.ShouldBeType <CakeException>().Message.ShouldContain("Failed to find MakeAppx.exe.");
        }
コード例 #2
0
        public void ShouldThrowIfAppPackagerCannotBeResolved()
        {
            // Given
            var fixture = new AppPackagerResolverFixture();

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

            // Then
            Assert.IsType <CakeException>(result);
            Assert.Equal("Failed to find MakeAppx.exe.", result.Message);
        }
コード例 #3
0
        public void ShouldThrowIfNotFoundOnDiscAndSdkRegistryPathCannotBeResolved()
        {
            // Given
            var fixture = new AppPackagerResolverFixture();

            fixture.GivenThatNoSdkRegistryKeyExist();

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

            // Then
            result.ShouldBeType <CakeException>().Message.ShouldContain("Failed to find MakeAppx.exe.");
        }
コード例 #4
0
        public void ShouldReturnFromRegistryIfFound()
        {
            // Given
            var fixture = new AppPackagerResolverFixture();

            fixture.GivenThatToolHasRegistryKey();

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

            // Then
            result.ShouldNotBeNull();
        }
コード例 #5
0
        public void ShouldReturnFromDiscIfFound(bool is64Bit)
        {
            // Given
            var fixture = new AppPackagerResolverFixture(is64Bit);

            fixture.GivenThatToolExistInKnownPath();

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

            // Then
            result.ShouldNotBeNull();
        }
コード例 #6
0
        public void ShouldThrowIfToolsIsNull()
        {
            // Given
            var fixture = new AppPackagerResolverFixture();

            fixture.Tools = null;

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

            // Then
            result.ShouldBeType <ArgumentNullException>().ParamName.ShouldEqual("tools");
        }
コード例 #7
0
        public void ShouldThrowIfToolsIsNull()
        {
            // Given
            var fixture = new AppPackagerResolverFixture();

            fixture.Tools = null;

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

            // Then
            Assert.IsType <ArgumentNullException>(result);
            Assert.Equal("tools", ((ArgumentNullException)result).ParamName);
        }