<commit_before>﻿module ViewTests

open System.IO
open NUnit.Framework
open FsUnit
open Anthology
open View
open StringHelpers
open Configuration

[<Test>]
let CheckSelectProject () =
    let file = FileInfo ("Anthology.xml")
    let antho = LoadAnthologyFromFile file
    
    let projects = SelectProjects antho.Projects ["cassandra-sharp-contrib"]
    projects |> should equal [ { Repository="cassandra-sharp-contrib"
                                 RelativeProjectFile="CassandraSharp.Contrib.log4net/CassandraSharp.Contrib.log4net-net45.csproj"
                                 ProjectGuid=ParseGuid "925833ed-8653-4e90-9c37-b5b6cb693cf4"
                                 AssemblyName="CassandraSharp.Contrib.log4net"
                                 OutputType=OutputType.Dll
                                 FxTarget="v4.5"   
                                 AssemblyReferences=["CassandraSharp.Interfaces"; "System" ]
                                 PackageReferences= [ "cassandra-sharp-interfaces"; "log4net"
                                                      "Rx-Core"; "Rx-Interfaces"; "Rx-Linq"; "Rx-Main"; "Rx-PlatformServices" ]
                                 ProjectReferences= [] }
                               { Repository="cassandra-sharp-contrib"
                                 RelativeProjectFile="CassandraSharp.Contrib.log4netUnitTests/CassandraSharp.Contrib.log4netUnitTests-net45.csproj"
                                 ProjectGuid= ParseGuid "9e8648a4-d25a-4cfa-aaee-20d9d63ff571"
                                 AssemblyName="CassandraSharp.Contrib.log4netUnitTests"
                                 OutputType=OutputType.Dll
                                 FxTarget="v4.5"
                                 AssemblyReferences= ["System"; "System.Core"]
                                 PackageReferences=["cassandra-sharp"; "cassandra-sharp-core"; "cassandra-sharp-interfaces"; "log4net" 
                                                    "NUnit"; "Rx-Core"; "Rx-Interfaces"; "Rx-Linq"; "Rx-Main"; "Rx-PlatformServices" ]
                                 ProjectReferences= [] } ]

[<Test>]
let CheckGenerateSolution () =
    let file = FileInfo ("Anthology.xml")
    let antho = LoadAnthologyFromFile file

    let projects = [ { Repository="cassandra-sharp-contrib"
                       RelativeProjectFile="CassandraSharp.Contrib.log4net/CassandraSharp.Contrib.log4net-net45.csproj"
                       ProjectGuid=ParseGuid "925833ed-8653-4e90-9c37-b5b6cb693cf4"
                       AssemblyName="CassandraSharp.Contrib.log4net"
                       OutputType=OutputType.Dll
                       FxTarget="v4.5"   
                       AssemblyReferences=[ "System" ]
                       PackageReferences= [ "log4net"
                                            "Rx-Core"; "Rx-Interfaces"; "Rx-Linq"; "Rx-Main"; "Rx-PlatformServices" ]
                       ProjectReferences= [ParseGuid "6f6eb447-9569-406a-a23b-c09b6dbdbe10"] }
                     { Repository="cassandra-sharp-contrib"
                       RelativeProjectFile="CassandraSharp.Contrib.log4netUnitTests/CassandraSharp.Contrib.log4netUnitTests-net45.csproj"
                       ProjectGuid= ParseGuid "9e8648a4-d25a-4cfa-aaee-20d9d63ff571"
                       AssemblyName="CassandraSharp.Contrib.log4netUnitTests"
                       OutputType=OutputType.Dll
                       FxTarget="v4.5"
                       AssemblyReferences= ["System"; "System.Core"]
                       PackageReferences=["log4net" 
                                          "NUnit"; "Rx-Core"; "Rx-Interfaces"; "Rx-Linq"; "Rx-Main"; "Rx-PlatformServices" ]
                       ProjectReferences= [ParseGuid "6f6eb447-9569-406a-a23b-c09b6dbdbe10"; ParseGuid "c1d252b7-d766-4c28-9c46-0696f896846c"; ParseGuid "925833ed-8653-4e90-9c37-b5b6cb693cf4" ] } ]

    let content = GenerateSolutionContent projects
    content |> Seq.iter (fun x -> printfn "%A" x)

    // NOTE: CassandraSharp.Contrib.log4netUnitTests must depend on CassandraSharp.Contrib.log4net
    //       other dependencies must not be set as outside solution scope (ie: no build order to be specified)
    content |> should equal [| ""
                               "Microsoft Visual Studio Solution File, Format Version 12.00"
                               "# Visual Studio 2013"
                               @"Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""CassandraSharp.Contrib.log4net-net45"", ""cassandra-sharp-contrib/CassandraSharp.Contrib.log4net/CassandraSharp.Contrib.log4net-net45.csproj"", ""{925833ed-8653-4e90-9c37-b5b6cb693cf4}"""
                               "\tProjectSection(ProjectDependencies) = postProject"<commit_msg>remove printfn in unit tests<commit_after>﻿module ViewTests

open System.IO
open NUnit.Framework
open FsUnit
open Anthology
open View
open StringHelpers
open Configuration

[<Test>]
let CheckSelectProject () =
    let file = FileInfo ("Anthology.xml")
    let antho = LoadAnthologyFromFile file
    
    let projects = SelectProjects antho.Projects ["cassandra-sharp-contrib"]
    projects |> should equal [ { Repository="cassandra-sharp-contrib"
                                 RelativeProjectFile="CassandraSharp.Contrib.log4net/CassandraSharp.Contrib.log4net-net45.csproj"
                                 ProjectGuid=ParseGuid "925833ed-8653-4e90-9c37-b5b6cb693cf4"
                                 AssemblyName="CassandraSharp.Contrib.log4net"
                                 OutputType=OutputType.Dll
                                 FxTarget="v4.5"   
                                 AssemblyReferences=["CassandraSharp.Interfaces"; "System" ]
                                 PackageReferences= [ "cassandra-sharp-interfaces"; "log4net"
                                                      "Rx-Core"; "Rx-Interfaces"; "Rx-Linq"; "Rx-Main"; "Rx-PlatformServices" ]
                                 ProjectReferences= [] }
                               { Repository="cassandra-sharp-contrib"
                                 RelativeProjectFile="CassandraSharp.Contrib.log4netUnitTests/CassandraSharp.Contrib.log4netUnitTests-net45.csproj"
                                 ProjectGuid= ParseGuid "9e8648a4-d25a-4cfa-aaee-20d9d63ff571"
                                 AssemblyName="CassandraSharp.Contrib.log4netUnitTests"
                                 OutputType=OutputType.Dll
                                 FxTarget="v4.5"
                                 AssemblyReferences= ["System"; "System.Core"]
                                 PackageReferences=["cassandra-sharp"; "cassandra-sharp-core"; "cassandra-sharp-interfaces"; "log4net" 
                                                    "NUnit"; "Rx-Core"; "Rx-Interfaces"; "Rx-Linq"; "Rx-Main"; "Rx-PlatformServices" ]
                                 ProjectReferences= [] } ]

[<Test>]
let CheckGenerateSolution () =
    let file = FileInfo ("Anthology.xml")
    let antho = LoadAnthologyFromFile file

    let projects = [ { Repository="cassandra-sharp-contrib"
                       RelativeProjectFile="CassandraSharp.Contrib.log4net/CassandraSharp.Contrib.log4net-net45.csproj"
                       ProjectGuid=ParseGuid "925833ed-8653-4e90-9c37-b5b6cb693cf4"
                       AssemblyName="CassandraSharp.Contrib.log4net"
                       OutputType=OutputType.Dll
                       FxTarget="v4.5"   
                       AssemblyReferences=[ "System" ]
                       PackageReferences= [ "log4net"
                                            "Rx-Core"; "Rx-Interfaces"; "Rx-Linq"; "Rx-Main"; "Rx-PlatformServices" ]
                       ProjectReferences= [ParseGuid "6f6eb447-9569-406a-a23b-c09b6dbdbe10"] }
                     { Repository="cassandra-sharp-contrib"
                       RelativeProjectFile="CassandraSharp.Contrib.log4netUnitTests/CassandraSharp.Contrib.log4netUnitTests-net45.csproj"
                       ProjectGuid= ParseGuid "9e8648a4-d25a-4cfa-aaee-20d9d63ff571"
                       AssemblyName="CassandraSharp.Contrib.log4netUnitTests"
                       OutputType=OutputType.Dll
                       FxTarget="v4.5"
                       AssemblyReferences= ["System"; "System.Core"]
                       PackageReferences=["log4net" 
                                          "NUnit"; "Rx-Core"; "Rx-Interfaces"; "Rx-Linq"; "Rx-Main"; "Rx-PlatformServices" ]
                       ProjectReferences= [ParseGuid "6f6eb447-9569-406a-a23b-c09b6dbdbe10"; ParseGuid "c1d252b7-d766-4c28-9c46-0696f896846c"; ParseGuid "925833ed-8653-4e90-9c37-b5b6cb693cf4" ] } ]

    let content = GenerateSolutionContent projects

    // NOTE: CassandraSharp.Contrib.log4netUnitTests must depend on CassandraSharp.Contrib.log4net
    //       other dependencies must not be set as outside solution scope (ie: no build order to be specified)
    content |> should equal [| ""
                               "Microsoft Visual Studio Solution File, Format Version 12.00"
                               "# Visual Studio 2013"
                               @"Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""CassandraSharp.Contrib.log4net-net45"", ""cassandra-sharp-contrib/CassandraSharp.Contrib.log4net/CassandraSharp.Contrib.log4net-net45.csproj"", ""{925833ed-8653-4e90-9c37-b5b6cb693cf4}"""
                               "\tProjectSection(ProjectDependencies) = postProject"
{'fraction_non_alphanumeric': 0.0983018668916781, 'fraction_numerical': 0.05252610484126147, 'mean_word_length': 1.7628205128205128, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 52, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7201840', 'n_tokens_mistral': 2984, 'n_tokens_neox': 2609, 'n_words': 368}