Skip to content

Commit acd77ef

Browse files
authored
Merge pull request #4924 from dotnet/master
Update live with current master
2 parents 8b011de + 0032553 commit acd77ef

File tree

46 files changed

+398
-513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+398
-513
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# .NET Docs
22

3-
This repo contains work-in-progress documentation for .NET. To contribute, see the [Contributing Guide](https://github.com/dotnet/docs/blob/master/CONTRIBUTING.md) and the [issues list](https://github.com/dotnet/docs/issues).
4-
5-
We welcome contributions to help us improve and complete the .NET docs. We anticipate that [Xamarin](http://developer.xamarin.com/api/root/classlib/), [Mono](http://docs.go-mono.com/?link=root%3a%2fclasslib) and [Unity](http://docs.unity3d.com/Manual/index.html) will also use this documentation.
6-
7-
This repository contains the conceptual documentation for .NET. The .NET documentation site is built from multiple repositories in addition to this one:
3+
This repository contains the conceptual documentation for .NET. The [.NET documentation site](https://docs.microsoft.com/dotnet) is built from multiple repositories in addition to this one:
84

95
- [Code samples and snippets](https://github.com/dotnet/samples)
106
- [API reference](https://github.com/dotnet/dotnet-api-docs)
117
- [.NET Compiler Platform SDK reference](https://github.com/dotnet/roslyn-api-docs)
128

139
Issues and tasks for all three of those repositories are tracked here.
1410

11+
We welcome contributions to help us improve and complete the .NET docs. To contribute, see the [Contributing Guide](https://github.com/dotnet/docs/blob/master/CONTRIBUTING.md) and the [issues list](https://github.com/dotnet/docs/issues).
12+
13+
We anticipate that [Xamarin](https://docs.microsoft.com/xamarin), [Mono](http://docs.go-mono.com/?link=root%3a%2fclasslib) and [Unity](http://docs.unity3d.com/Manual/index.html) will also use this documentation.
14+
1515
This project has adopted the code of conduct defined by the Contributor Covenant
1616
to clarify expected behavior in our community.
1717
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

docs/core/build/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ This article gives guidance to developers who want to build and distribute their
2020

2121
## Build the CLR from source
2222

23-
The source code for the .NET CoreCLR can be found in [the `dotnet/coreclr` repository on GitHub](https://github.com/dotnet/coreclr/).
23+
The source code for the .NET CoreCLR can be found in the [dotnet/coreclr](https://github.com/dotnet/coreclr/) repository on GitHub.
2424

2525
The build currently depends on the following prerequisites:
2626
* [Git](https://git-scm.com/)
2727
* [CMake](https://cmake.org/)
2828
* [Python](https://www.python.org/)
2929
* a C++ compiler.
3030

31-
After you've installed these prerequisites are installed, you can build the CLR by invoking the build script (`build.cmd` on Windows, or `build.sh` on Linux and macOS) at the base of [the CoreCLR repository](https://github.com/dotnet/coreclr/).
31+
After you've installed these prerequisites are installed, you can build the CLR by invoking the build script (`build.cmd` on Windows, or `build.sh` on Linux and macOS) at the base of the [dotnet/coreclr](https://github.com/dotnet/coreclr/) repository.
3232

3333
Installing the components differ depending on the operating system (OS). See the build instructions for your specific OS:
3434

@@ -78,12 +78,12 @@ There are two basic techniques for using your new runtime:
7878
2. **Use corerun.exe to run an application using unpackaged DLLs**.
7979
This repository also defines a simple host called corerun.exe that does NOT take any dependency on NuGet.
8080
You need to tell the host where to get the required DLLs you actually use, and you have to manually gather them together.
81-
This technique is used by all the tests in [the CoreCLR repo](https://github.com/dotnet/coreclr), and is useful for quick local 'edit-compile-debug' loop such as preliminary unit testing.
81+
This technique is used by all the tests in the [dotnet/coreclr](https://github.com/dotnet/coreclr) repo, and is useful for quick local 'edit-compile-debug' loop such as preliminary unit testing.
8282
See [Executing .NET Core Apps with CoreRun.exe](https://github.com/dotnet/coreclr/blob/master/Documentation/workflow/UsingCoreRun.md) for details on using this technique.
8383

8484
## Build the CLI from source
8585

86-
The source code for the .NET Core CLI can be found in [the `dotnet/cli` repository on GitHub](https://github.com/dotnet/cli/).
86+
The source code for the .NET Core CLI can be found in the [dotnet/cli](https://github.com/dotnet/cli/) repository on GitHub.
8787

8888
In order to build the .NET Core CLI, you need the following installed on your machine.
8989

docs/core/macos-prerequisites.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ Download and install the .NET Core SDK from [.NET Downloads](https://www.microso
6262

6363
---
6464

65-
## Increase the maximum open file limit
65+
## Increase the maximum open file limit (.NET Core versions before .NET Core SDK 2.0.2)
6666

67-
The default open file limit on macOS may not be sufficient for some .NET Core workloads, such as restoring projects or running unit tests.
67+
In older .NET Core versions (before .NET Core SDK 2.0.2), the default open file limit on macOS may not be sufficient for some .NET Core workloads, such as restoring projects or running unit tests.
6868

6969
You can increase this limit by following these steps:
7070

docs/core/testing/unit-testing-fsharp-with-dotnet-test.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Make *MathService* the current directory and run [`dotnet new classlib -lang F#`
3232

3333
```fsharp
3434
module MyMath =
35-
let sumOfSquares xs = raise (System.NotImplementedException("You haven't written a test yet!"))
35+
let squaresOfOdds xs = raise (System.NotImplementedException("You haven't written a test yet!"))
3636
```
3737

3838
Change the directory back to the *unit-testing-with-fsharp* directory. Run [`dotnet sln add .\MathService\MathService.fsproj`](../tools/dotnet-sln.md)
@@ -99,22 +99,22 @@ let ``Fail every time`` () = Assert.True(false)
9999

100100
The `[<Fact>]` attribute denotes a test method that is run by the test runner. From the *unit-testing-with-fsharp*, execute [`dotnet test`](../tools/dotnet-test.md) to build the tests and the class library and then run the tests. The xUnit test runner contains the program entry point to run your tests. `dotnet test` starts the test runner using the unit test project you've created.
101101

102-
These two tests show the most basic passing and failing tests. `My test` passes, and `Fail every time` fails. Now, create a test for the `sumOfSquares` method. The `sumOfSquares` method returns the sum of the squares of all odd integer values that are part of the input sequence. Rather than trying to write all of those functions at once, you can iteratively create tests that validate the functionality. Making each test pass means creating the necessary functionality for the method.
102+
These two tests show the most basic passing and failing tests. `My test` passes, and `Fail every time` fails. Now, create a test for the `squaresOfOdds` method. The `squaresOfOdds` method returns a sequence of the squares of all odd integer values that are part of the input sequence. Rather than trying to write all of those functions at once, you can iteratively create tests that validate the functionality. Making each test pass means creating the necessary functionality for the method.
103103

104-
The simplest test we can write is to call `sumOfSquares` with all even numbers, where the result should be an empty sequence of integers. Here's that test:
104+
The simplest test we can write is to call `squaresOfOdds` with all even numbers, where the result should be an empty sequence of integers. Here's that test:
105105

106106
```fsharp
107107
[<Fact>]
108-
let ``Sum of evens returns empty collection`` () =
108+
let ``Sequence of Evens returns empty collection`` () =
109109
let expected = Seq.empty<int>
110-
let actual = MyMath.sumOfSquares [2; 4; 6; 8; 10]
110+
let actual = MyMath.squaresOfOdds [2; 4; 6; 8; 10]
111111
Assert.Equal<Collections.Generic.IEnumerable<int>>(expected, actual)
112112
```
113113

114114
Your test fails. You haven't created the implementation yet. Make this test by writing the simplest code in the `MathService` class that works:
115115

116116
```csharp
117-
let sumOfSquares xs =
117+
let squaresOfOdds xs =
118118
Seq.empty<int>
119119
```
120120

@@ -126,18 +126,18 @@ Now that you've made one test pass, it's time to write more. The next simple cas
126126

127127
```fsharp
128128
[<Fact>]
129-
let ``Sum of sequences of Ones and Evens`` () =
129+
let ``Sequences of Ones and Evens returns Ones`` () =
130130
let expected = [1; 1; 1; 1]
131-
let actual = MyMath.sumOfSquares [2; 1; 4; 1; 6; 1; 8; 1; 10]
131+
let actual = MyMath.squaresOfOdds [2; 1; 4; 1; 6; 1; 8; 1; 10]
132132
Assert.Equal<Collections.Generic.IEnumerable<int>>(expected, actual)
133133
```
134134

135-
Executing `dotnet test` runs your tests and shows you that the new test fails. Now, update the `sumOfSquares` method to handle this new test. You filter all the even numbers out of the sequence to make this test pass. You can do that by writing a small filter function and using `Seq.filter`:
135+
Executing `dotnet test` runs your tests and shows you that the new test fails. Now, update the `squaresOfOdds` method to handle this new test. You filter all the even numbers out of the sequence to make this test pass. You can do that by writing a small filter function and using `Seq.filter`:
136136

137137
```fsharp
138138
let private isOdd x = x % 2 <> 0
139139

140-
let sumOfSquares xs =
140+
let squaresOfOdds xs =
141141
xs
142142
|> Seq.filter isOdd
143143
```
@@ -148,7 +148,7 @@ There's one more step to go: square each of the odd numbers. Start by writing a
148148
[<Fact>]
149149
let ``SquaresOfOdds works`` () =
150150
let expected = [1; 9; 25; 49; 81]
151-
let actual = MyMath.sumOfSquares [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
151+
let actual = MyMath.squaresOfOdds [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
152152
Assert.Equal(expected, actual)
153153
```
154154

@@ -158,7 +158,7 @@ You can fix the test by piping the filtered sequence through a map operation to
158158
let private square x = x * x
159159
let private isOdd x = x % 2 <> 0
160160

161-
let sumOfSquares xs =
161+
let squaresOfOdds xs =
162162
xs
163163
|> Seq.filter isOdd
164164
|> Seq.map square

docs/core/testing/unit-testing-fsharp-with-mstest.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Make *MathService* the current directory and run [`dotnet new classlib -lang F#`
3232

3333
```fsharp
3434
module MyMath =
35-
let sumOfSquares xs = raise (System.NotImplementedException("You haven't written a test yet!"))
35+
let squaresOfOdds xs = raise (System.NotImplementedException("You haven't written a test yet!"))
3636
```
3737

3838
Change the directory back to the *unit-testing-with-fsharp* directory. Run [`dotnet sln add .\MathService\MathService.fsproj`](../tools/dotnet-sln.md)
@@ -108,15 +108,15 @@ type TestClass () =
108108

109109
The `[<TestClass>]` attribute denotes a class that contains tests. The `[<TestMethod>]` attribute denotes a test method that is run by the test runner. From the *unit-testing-with-fsharp* directory, execute [`dotnet test`](../tools/dotnet-test.md) to build the tests and the class library and then run the tests. The MSTest test runner contains the program entry point to run your tests. `dotnet test` starts the test runner using the unit test project you've created.
110110

111-
These two tests show the most basic passing and failing tests. `My test` passes, and `Fail every time` fails. Now, create a test for the `sumOfSquares` method. The `sumOfSquares` method returns the sum of the squares of all odd integer values that are part of the input sequence. Rather than trying to write all of those functions at once, you can iteratively create tests that validate the functionality. Making each test pass means creating the necessary functionality for the method.
111+
These two tests show the most basic passing and failing tests. `My test` passes, and `Fail every time` fails. Now, create a test for the `squaresOfOdds` method. The `squaresOfOdds` method returns a list of the squares of all odd integer values that are part of the input sequence. Rather than trying to write all of those functions at once, you can iteratively create tests that validate the functionality. Making each test pass means creating the necessary functionality for the method.
112112

113-
The simplest test we can write is to call `sumOfSquares` with all even numbers, where the result should be an empty sequence of integers. Here's that test:
113+
The simplest test we can write is to call `squaresOfOdds` with all even numbers, where the result should be an empty sequence of integers. Here's that test:
114114

115115
```fsharp
116116
[<TestMethod>]
117117
member this.TestEvenSequence() =
118118
let expected = Seq.empty<int> |> Seq.toList
119-
let actual = MyMath.sumOfSquares [2; 4; 6; 8; 10]
119+
let actual = MyMath.squaresOfOdds [2; 4; 6; 8; 10]
120120
Assert.AreEqual(expected, actual)
121121
```
122122

@@ -125,7 +125,7 @@ Notice that the `expected` sequence has been converted to a list. The MSTest lib
125125
When you run the test, you see that your test fails. You haven't created the implementation yet. Make this test by writing the simplest code in the `Mathservice` class that works:
126126

127127
```csharp
128-
let sumOfSquares xs =
128+
let squaresOfOdds xs =
129129
Seq.empty<int> |> Seq.toList
130130
```
131131

@@ -137,18 +137,18 @@ Now that you've made one test pass, it's time to write more. The next simple cas
137137

138138
```fsharp
139139
[<TestMethod>]
140-
member public this.SumOnesAndEvens() =
140+
member public this.TestOnesAndEvens() =
141141
let expected = [1; 1; 1; 1]
142-
let actual = MyMath.sumOfSquares [2; 1; 4; 1; 6; 1; 8; 1; 10]
142+
let actual = MyMath.squaresOfOdds [2; 1; 4; 1; 6; 1; 8; 1; 10]
143143
Assert.AreEqual(expected, actual)
144144
```
145145

146-
Executing `dotnet test` fails the new test. You must update the `sumOfSquares` method to handle this new test. You must filter all the even numbers out of the sequence to make this test pass. You can do that by writing a small filter function and using `Seq.filter`:
146+
Executing `dotnet test` fails the new test. You must update the `squaresOfOdds` method to handle this new test. You must filter all the even numbers out of the sequence to make this test pass. You can do that by writing a small filter function and using `Seq.filter`:
147147

148148
```fsharp
149149
let private isOdd x = x % 2 <> 0
150150

151-
let sumOfSquares xs =
151+
let squaresOfOdds xs =
152152
xs
153153
|> Seq.filter isOdd |> Seq.toList
154154
```
@@ -161,7 +161,7 @@ There's one more step to go: square each of the odd numbers. Start by writing a
161161
[<TestMethod>]
162162
member public this.TestSquaresOfOdds() =
163163
let expected = [1; 9; 25; 49; 81]
164-
let actual = MyMath.sumOfSquares [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
164+
let actual = MyMath.squaresOfOdds [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
165165
Assert.AreEqual(expected, actual)
166166
```
167167

@@ -171,7 +171,7 @@ You can fix the test by piping the filtered sequence through a map operation to
171171
let private square x = x * x
172172
let private isOdd x = x % 2 <> 0
173173

174-
let sumOfSquares xs =
174+
let squaresOfOdds xs =
175175
xs
176176
|> Seq.filter isOdd
177177
|> Seq.map square

docs/core/testing/unit-testing-fsharp-with-nunit.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Make *MathService* the current directory and run [`dotnet new classlib -lang F#`
2929

3030
```fsharp
3131
module MyMath =
32-
let sumOfSquares xs = raise (System.NotImplementedException("You haven't written a test yet!"))
32+
let squaresOfOdds xs = raise (System.NotImplementedException("You haven't written a test yet!"))
3333
```
3434

3535
Change the directory back to the *unit-testing-with-fsharp* directory. Run [`dotnet sln add .\MathService\MathService.fsproj`](../tools/dotnet-sln.md)
@@ -113,15 +113,15 @@ type TestClass () =
113113

114114
The `[<TestFixture>]` attribute denotes a class that contains tests. The `[<Test>]` attribute denotes a test method that is run by the test runner. From the *unit-testing-with-fsharp* directory, execute [`dotnet test`](../tools/dotnet-test.md) to build the tests and the class library and then run the tests. The NUnit test runner contains the program entry point to run your tests. `dotnet test` starts the test runner using the unit test project you've created.
115115

116-
These two tests show the most basic passing and failing tests. `My test` passes, and `Fail every time` fails. Now, create a test for the `sumOfSquares` method. The `sumOfSquares` method returns the sum of the squares of all odd integer values that are part of the input sequence. Rather than trying to write all of those functions at once, you can iteratively create tests that validate the functionality. Making each test pass means creating the necessary functionality for the method.
116+
These two tests show the most basic passing and failing tests. `My test` passes, and `Fail every time` fails. Now, create a test for the `squaresOfOdds` method. The `squaresOfOdds` method returns a sequence of the squares of all odd integer values that are part of the input sequence. Rather than trying to write all of those functions at once, you can iteratively create tests that validate the functionality. Making each test pass means creating the necessary functionality for the method.
117117

118-
The simplest test we can write is to call `sumOfSquares` with all even numbers, where the result should be an empty sequence of integers. Here's that test:
118+
The simplest test we can write is to call `squaresOfOdds` with all even numbers, where the result should be an empty sequence of integers. Here's that test:
119119

120120
```fsharp
121121
[<Test>]
122122
member this.TestEvenSequence() =
123-
let expected = Seq.empty<int> |> Seq.toList
124-
let actual = MyMath.sumOfSquares [2; 4; 6; 8; 10]
123+
let expected = Seq.empty<int>
124+
let actual = MyMath.squaresOfOdds [2; 4; 6; 8; 10]
125125
Assert.That(actual, Is.EqualTo(expected))
126126
```
127127

@@ -130,8 +130,8 @@ Notice that the `expected` sequence has been converted to a list. The NUnit fram
130130
When you run the test, you see that your test fails. You haven't created the implementation yet. Make this test by writing the simplest code in the `Mathservice` class that works:
131131

132132
```csharp
133-
let sumOfSquares xs =
134-
Seq.empty<int> |> Seq.toList
133+
let squaresOfOdds xs =
134+
Seq.empty<int>
135135
```
136136

137137
In the *unit-testing-with-fsharp* directory, run `dotnet test` again. The `dotnet test` command runs a build for the `MathService` project and then for the `MathService.Tests` project. After building both projects, it runs this single test. It passes.
@@ -142,21 +142,20 @@ Now that you've made one test pass, it's time to write more. The next simple cas
142142

143143
```fsharp
144144
[<Test>]
145-
member public this.SumOnesAndEvens() =
145+
member public this.TestOnesAndEvens() =
146146
let expected = [1; 1; 1; 1]
147-
let actual = MyMath.sumOfSquares [2; 1; 4; 1; 6; 1; 8; 1; 10]
147+
let actual = MyMath.squaresOfOdds [2; 1; 4; 1; 6; 1; 8; 1; 10]
148148
Assert.That(actual, Is.EqualTo(expected))
149149
```
150150

151-
Executing `dotnet test` fails the new test. You must update the `sumOfSquares` method to handle this new test. You must filter all the even numbers out of the sequence to make this test pass. You can do that by writing a small filter function and using `Seq.filter`:
151+
Executing `dotnet test` fails the new test. You must update the `squaresOfOdds` method to handle this new test. You must filter all the even numbers out of the sequence to make this test pass. You can do that by writing a small filter function and using `Seq.filter`:
152152

153153
```fsharp
154154
let private isOdd x = x % 2 <> 0
155155

156-
let sumOfSquares xs =
156+
let squaresOfOdds xs =
157157
xs
158158
|> Seq.filter isOdd
159-
|> Seq.toList
160159
```
161160

162161
Notice the call to `Seq.toList`. That creates a list, which implements the <xref:System.Collections.ICollection> interface.
@@ -167,7 +166,7 @@ There's one more step to go: square each of the odd numbers. Start by writing a
167166
[<Test>]
168167
member public this.TestSquaresOfOdds() =
169168
let expected = [1; 9; 25; 49; 81]
170-
let actual = MyMath.sumOfSquares [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
169+
let actual = MyMath.squaresOfOdds [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
171170
Assert.That(actual, Is.EqualTo(expected))
172171
```
173172

@@ -177,11 +176,10 @@ You can fix the test by piping the filtered sequence through a map operation to
177176
let private square x = x * x
178177
let private isOdd x = x % 2 <> 0
179178

180-
let sumOfSquares xs =
179+
let squaresOfOdds xs =
181180
xs
182181
|> Seq.filter isOdd
183182
|> Seq.map square
184-
|> Seq.toList
185183
```
186184

187185
You've built a small library and a set of unit tests for that library. You've structured the solution so that adding new packages and tests is part of the normal workflow. You've concentrated most of your time and effort on solving the goals of the application.

0 commit comments

Comments
 (0)