From 203f9f21b570370f64a7e0df612fb0688c9286b7 Mon Sep 17 00:00:00 2001 From: vologin-dmitry Date: Fri, 10 Apr 2020 18:55:11 +0300 Subject: [PATCH 1/2] Add first and second test --- .../TestFirstTest/ListMinTest.fs | 12 ++++++ .../TestProjectOne/TestFirstTest/Program.fs | 1 + .../TestFirstTest/TestProjectOne.Tests.fsproj | 25 +++++++++++++ semester4/TestProjectOne/TestProjectOne.sln | 31 ++++++++++++++++ .../TestProjectOne/TestProjectOne/DrowThis.fs | 37 +++++++++++++++++++ .../TestProjectOne/TestProjectOne/ListMin.fs | 5 +++ .../TestProjectOne/TestProjectOne/Program.fs | 8 ++++ .../TestProjectOne/TestProjectOne.fsproj | 14 +++++++ 8 files changed, 133 insertions(+) create mode 100644 semester4/TestProjectOne/TestFirstTest/ListMinTest.fs create mode 100644 semester4/TestProjectOne/TestFirstTest/Program.fs create mode 100644 semester4/TestProjectOne/TestFirstTest/TestProjectOne.Tests.fsproj create mode 100644 semester4/TestProjectOne/TestProjectOne.sln create mode 100644 semester4/TestProjectOne/TestProjectOne/DrowThis.fs create mode 100644 semester4/TestProjectOne/TestProjectOne/ListMin.fs create mode 100644 semester4/TestProjectOne/TestProjectOne/Program.fs create mode 100644 semester4/TestProjectOne/TestProjectOne/TestProjectOne.fsproj diff --git a/semester4/TestProjectOne/TestFirstTest/ListMinTest.fs b/semester4/TestProjectOne/TestFirstTest/ListMinTest.fs new file mode 100644 index 0000000..1154fa0 --- /dev/null +++ b/semester4/TestProjectOne/TestFirstTest/ListMinTest.fs @@ -0,0 +1,12 @@ +module GetListMinimal.Test + +open NUnit.Framework +open ListMin + +[] +let listMinTest = + Assert.AreEqual(32, getListMin [32;2141;4215;123]) + Assert.AreEqual(0, getListMin [32;0;4215;123]) + Assert.AreEqual(-5, getListMin [-1;-2;-3;-4;-5]) + Assert.AreEqual(-1, getListMin [-1;-1;-1;-1;-1]) + \ No newline at end of file diff --git a/semester4/TestProjectOne/TestFirstTest/Program.fs b/semester4/TestProjectOne/TestFirstTest/Program.fs new file mode 100644 index 0000000..0695f84 --- /dev/null +++ b/semester4/TestProjectOne/TestFirstTest/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/semester4/TestProjectOne/TestFirstTest/TestProjectOne.Tests.fsproj b/semester4/TestProjectOne/TestFirstTest/TestProjectOne.Tests.fsproj new file mode 100644 index 0000000..709a689 --- /dev/null +++ b/semester4/TestProjectOne/TestFirstTest/TestProjectOne.Tests.fsproj @@ -0,0 +1,25 @@ + + + + netcoreapp3.1 + + false + false + + + + + + + + + + + + + + + + + + diff --git a/semester4/TestProjectOne/TestProjectOne.sln b/semester4/TestProjectOne/TestProjectOne.sln new file mode 100644 index 0000000..c6f2f45 --- /dev/null +++ b/semester4/TestProjectOne/TestProjectOne.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29926.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TestProjectOne", "TestProjectOne\TestProjectOne.fsproj", "{F7929C74-6945-447E-B8BC-972F5F8B3FC0}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TestProjectOne.Tests", "TestFirstTest\TestProjectOne.Tests.fsproj", "{4CB4CBB0-DED9-4E61-90EE-D9F0CCD3FB15}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F7929C74-6945-447E-B8BC-972F5F8B3FC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7929C74-6945-447E-B8BC-972F5F8B3FC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7929C74-6945-447E-B8BC-972F5F8B3FC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7929C74-6945-447E-B8BC-972F5F8B3FC0}.Release|Any CPU.Build.0 = Release|Any CPU + {4CB4CBB0-DED9-4E61-90EE-D9F0CCD3FB15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CB4CBB0-DED9-4E61-90EE-D9F0CCD3FB15}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CB4CBB0-DED9-4E61-90EE-D9F0CCD3FB15}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CB4CBB0-DED9-4E61-90EE-D9F0CCD3FB15}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {68526307-140B-498B-AB4A-759EC488BF23} + EndGlobalSection +EndGlobal diff --git a/semester4/TestProjectOne/TestProjectOne/DrowThis.fs b/semester4/TestProjectOne/TestProjectOne/DrowThis.fs new file mode 100644 index 0000000..d24b2fe --- /dev/null +++ b/semester4/TestProjectOne/TestProjectOne/DrowThis.fs @@ -0,0 +1,37 @@ +module Draw + +/// Create List that contains wanted picture +let getBoxList (n: int) = + + /// Returns lines + let rec otherLines current line = + if current = n then + otherLines (current - 1) "*" + else if (current = 1) then + "*" + line + else + otherLines (current - 1) " " + + /// Returns upper and bottom lines + let rec firstAndLastLine pos line = + if pos > 0 then firstAndLastLine (pos - 1) (line + "*") + else line + + /// Creates List of strings we need + let rec getList linePos (list: List) = + match linePos with + | number when number < 1 -> printfn "%s" "ERROR!!" + [] + | 1 -> (list @ [firstAndLastLine n ""]) + | a when a = n -> getList (linePos - 1) [(firstAndLastLine n "")] + | _ -> getList (linePos - 1) (list @ [otherLines n ""]) + + getList n [] + +/// Prints our list +let rec printPicture (list: List) = + match list.Length with + | 0 -> printfn "" + | 1 -> printfn "%s" list.Head + | _ -> printfn "%s" list.Head + printPicture list.Tail \ No newline at end of file diff --git a/semester4/TestProjectOne/TestProjectOne/ListMin.fs b/semester4/TestProjectOne/TestProjectOne/ListMin.fs new file mode 100644 index 0000000..31bd68b --- /dev/null +++ b/semester4/TestProjectOne/TestProjectOne/ListMin.fs @@ -0,0 +1,5 @@ +module ListMin + +let getLess a b = if a < b then a else b + +let getListMin list = List.fold (getLess) (List.head list) (list) \ No newline at end of file diff --git a/semester4/TestProjectOne/TestProjectOne/Program.fs b/semester4/TestProjectOne/TestProjectOne/Program.fs new file mode 100644 index 0000000..a7458f5 --- /dev/null +++ b/semester4/TestProjectOne/TestProjectOne/Program.fs @@ -0,0 +1,8 @@ +// Learn more about F# at http://fsharp.org + +open System + +[] +let main argv = + printfn "Hello World from F#!" + 0 // return an integer exit code diff --git a/semester4/TestProjectOne/TestProjectOne/TestProjectOne.fsproj b/semester4/TestProjectOne/TestProjectOne/TestProjectOne.fsproj new file mode 100644 index 0000000..913c1ce --- /dev/null +++ b/semester4/TestProjectOne/TestProjectOne/TestProjectOne.fsproj @@ -0,0 +1,14 @@ + + + + Exe + netcoreapp3.1 + + + + + + + + + From 3604e27af702ceca3a052bfa7dd7f33000ae3585 Mon Sep 17 00:00:00 2001 From: vologin-dmitry Date: Fri, 10 Apr 2020 19:01:37 +0300 Subject: [PATCH 2/2] modidfied appveyor and gitignore --- .gitignore | 376 ++++++--------------------------------------------- appveyor.yml | 4 +- 2 files changed, 42 insertions(+), 338 deletions(-) diff --git a/.gitignore b/.gitignore index 74941b9..d0f9f16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,336 +1,40 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ -**/Properties/launchSettings.json - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ -.user -.filters -#This is mine and this is now -.bin/ -.obj/ -.Properties/ \ No newline at end of file +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Another things (VS) +**/.vs +*.vcxproj.user +**/Debug +**/bin +**/obj +*/packages \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 855f34f..5ef75e3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ image: Visual Studio 2017 before_build: - - nuget restore semester2/6.1/HW6T2.sln + - nuget restore semester4/TestProjectOne/TestProjectOne.sln build: - project: semester2/2.3/2.3.sln + project: semester4/TestProjectOne/TestProjectOne.sln