Beispiel #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.");
        }
Beispiel #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);
        }
Beispiel #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.");
        }
Beispiel #4
0
        public void ShouldReturnFromRegistryIfFound()
        {
            // Given
            var fixture = new AppPackagerResolverFixture();

            fixture.GivenThatToolHasRegistryKey();

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

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

            fixture.GivenThatToolExistInKnownPath();

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

            // Then
            result.ShouldNotBeNull();
        }
Beispiel #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");
        }
Beispiel #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);
        }