Beispiel #1
0
            public void Should_Read_Embedded_Resource(string reportName)
            {
                // When
                var result = EmbeddedResourceHelper.GetReportStyleSheet(reportName);

                // Then
                result.ShouldNotBeNullOrWhiteSpace();
            }
Beispiel #2
0
            public void Should_Throw_If_ReportName_Is_Empty()
            {
                // Given / When
                var result = Record.Exception(() => EmbeddedResourceHelper.GetReportStyleSheet(string.Empty));

                // Then
                result.IsArgumentOutOfRangeException("reportName");
            }
Beispiel #3
0
            public void Should_Throw_If_Unknown_Report_Name()
            {
                // Given / When
                var result = Record.Exception(() => EmbeddedResourceHelper.GetReportStyleSheet("Foo"));

                // Then
                result.IsArgumentOutOfRangeException("reportName");
            }
Beispiel #4
0
            public void Should_Throw_If_ReportName_Is_Null()
            {
                // Given / When
                var result = Record.Exception(() => EmbeddedResourceHelper.GetReportStyleSheet(null));

                // Then
                result.IsArgumentNullException("reportName");
            }
Beispiel #5
0
            public void Should_Return_Report(string logfileResourceName, string reportName)
            {
                // Given
                string logfileContent;

                using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.CodeAnalysisReporting.Tests.Testfiles." + logfileResourceName))
                {
                    using (var sr = new StreamReader(stream))
                    {
                        logfileContent = sr.ReadToEnd();
                    }
                }

                // When
                var result =
                    MsBuildCodeAnalysisReporter.CreateCodeAnalysisReport(
                        logfileContent,
                        EmbeddedResourceHelper.GetReportStyleSheet(reportName));

                // Then
                result.ShouldNotBeNullOrWhiteSpace();
            }