-
Notifications
You must be signed in to change notification settings - Fork 0
Testattempt4 #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vologin-dmitry
wants to merge
2
commits into
master
Choose a base branch
from
testattempt4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Testattempt4 #63
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -333,4 +333,5 @@ ASALocalRun/ | |
| #This is mine and this is now | ||
| .bin/ | ||
| .obj/ | ||
| .Properties/ | ||
| .Properties/ | ||
| /semester4/SecondHomework | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| image: Visual Studio 2017 | ||
| image: Visual Studio 2019 | ||
|
|
||
| before_build: | ||
| - nuget restore semester2/6.1/HW6T2.sln | ||
| - nuget restore semester4/TestAttempt4/TestAttempt.sln | ||
|
|
||
| build: | ||
| project: semester2/2.3/2.3.sln | ||
| project: semester4/TestAttempt4/TestAttempt.sln |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module Program = let [<EntryPoint>] main _ = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
|
||
| <IsPackable>false</IsPackable> | ||
| <GenerateProgramFile>false</GenerateProgramFile> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="nunit" Version="3.12.0" /> | ||
| <PackageReference Include="NUnit3TestAdapter" Version="3.15.1" /> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="UnitTest1.fs" /> | ||
| <Compile Include="Program.fs" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\TestAttempt\TestAttempt.fsproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| module ThirdTimeTests | ||
|
|
||
| open NUnit.Framework | ||
| open Queue | ||
| open FsUnit | ||
|
|
||
| let mutable queue = new Queue<string>() | ||
|
|
||
| [<SetUp>] | ||
| let Setup () = queue <- new Queue<string>() | ||
|
|
||
| [<Test>] | ||
| let EmptyTest () = | ||
| Assert.True(queue.IsEmpty) | ||
|
|
||
| [<Test>] | ||
| let OneElementTest () = | ||
| queue.Enqueue "hello" | ||
| Assert.False(queue.IsEmpty) | ||
|
|
||
| [<Test>] | ||
| let SimpleTest() = | ||
| queue.Enqueue "1" | ||
| queue.Enqueue "2" | ||
| Assert.AreEqual("1", queue.Dequeue()) | ||
| Assert.AreEqual("2", queue.Dequeue()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FsUbit же, зачем Assert.AreEqual |
||
|
|
||
| [<Test>] | ||
| let ExceptionTest () = Assert.Throws<System.IndexOutOfRangeException>((fun () -> queue.Dequeue() |>ignore)) |> ignore | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TestAttempt", "TestAttempt\TestAttempt.fsproj", "{C613B135-69E3-42CC-BD94-E13A5715ECD8}" | ||
| EndProject | ||
| Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "QueueTests", "QueueTests\QueueTests.fsproj", "{B8C0D5E7-9DA4-453F-AA60-9EDB6F779CC9}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {C613B135-69E3-42CC-BD94-E13A5715ECD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {C613B135-69E3-42CC-BD94-E13A5715ECD8}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {C613B135-69E3-42CC-BD94-E13A5715ECD8}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {C613B135-69E3-42CC-BD94-E13A5715ECD8}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {B8C0D5E7-9DA4-453F-AA60-9EDB6F779CC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {B8C0D5E7-9DA4-453F-AA60-9EDB6F779CC9}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {B8C0D5E7-9DA4-453F-AA60-9EDB6F779CC9}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {B8C0D5E7-9DA4-453F-AA60-9EDB6F779CC9}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {AA23B06E-C86F-4BBC-A63E-374C252C6C87} | ||
| EndGlobalSection | ||
| EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Learn more about F# at http://fsharp.org | ||
|
|
||
| open System | ||
|
|
||
| [<EntryPoint>] | ||
| let main argv = | ||
| printfn "Hello World from F#!" | ||
| 0 // return an integer exit code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| module Queue | ||
|
|
||
| ///Простая очередь | ||
| type Queue<'a>() = | ||
| let mutable list = [] | ||
|
|
||
| ///Добавить в элемент | ||
| member this.Enqueue (value : 'a) = | ||
| let reversed = List.rev list | ||
| list <- List.rev (value :: reversed) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ну, так можно, но можно было просто сконкатенировать в хвост. Работало бы вдвое быстрее :) |
||
|
|
||
| ///Получить первый в очереди элемент | ||
| member this.Dequeue() = | ||
| match list.Length with | ||
| | 0 -> raise (System.IndexOutOfRangeException("Queue is empty!")) | ||
| | _ -> let head = list.Head | ||
| list <- list.Tail | ||
| head | ||
|
|
||
| ///Узнать количество элементов в очереди | ||
| member this.Length() = list.Length | ||
|
|
||
| ///Узнать является ли очередь пустой | ||
| member this.IsEmpty = list.IsEmpty | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>netcoreapp3.1</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="Queue.fs" /> | ||
| <Compile Include="Program.fs" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="FsUnit" Version="3.8.1" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вообще, это обычные функции, в F# они пишутся со строчной