Git Product home page Git Product logo

csharp's Introduction

Exercism C# Track

Test

Exercism exercises in C#

Contributing Guide

Please see the contributing guide

Adding a new exercise

To add a new exercise, run the bin/add-new-exercise.ps1 PowerShell script:

pwsh bin/add-new-exercise.ps1 bob

This will create all the necessary files and tests for you. Then you just need to implement the Example.cs file and to check if the generated tests make sense. Parameters and examples for running the script can be found in the script file.

Support

Need assistance? Check out the Building Exercism subcategory on the Exercism forum where you can get support and ask questions.

csharp's People

Contributors

18-f-cali avatar bmeverett avatar bobahop avatar bressain avatar chrispritchard avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar erikschierboom avatar exercism-bot avatar faisalafroz avatar github-actions[bot] avatar gkotfis avatar hannaborodina avatar ihid avatar jmbradnan avatar joce avatar jwood803 avatar kytrinyx avatar martinfreedman avatar mdrakiburrahman avatar michalporeba avatar mikedamay avatar nextnebula avatar pstarliu avatar robkeim avatar rprouse avatar shamils avatar valentin-p avatar yzalvin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csharp's Issues

Verify contents and format of track documentation

Each language track has documentation in the docs/ directory, which gets included on the site
on each track-specific set of pages under /languages.

We've added some general guidelines about how we'd like the track to be documented in exercism/exercism#3315
which can be found at https://github.com/exercism/exercism.io/blob/master/docs/writing-track-documentation.md

Please take a moment to look through the documentation about documentation, and make sure that
the track is following these guidelines. Pay particularly close attention to how to use images
in the markdown files.

Lastly, if you find that the guidelines are confusing or missing important details, then a pull request
would be greatly appreciated.

Make Hamming conform to official definition

From issue exercism/exercism#1867

Wikipedia says the Hamming distance is not defined for strings of different length.

I am not saying the problems cannot be different, but for such a well-defined concept it would make sense to stick to one definition, especially when the READMEs provide so little information about what is expected from the implementation.

Let's clean this up so that we're using the official definition.

gigasecond: use times (not dates) for inputs and outputs

A duration of a gigasecond should be measured in seconds, not
days.

The gigasecond problem has been implemented in a number of languages,
and this issue has been generated for each of these language tracks.
This may already be fixed in this track, if so, please make a note of it
and close the issue.

There has been some discussion about whether or not gigaseconds should
take daylight savings time into account, and the conclusion was "no", since
not all locations observe daylight savings time.

Fix AppVeyor build

AppVeyor builds are failing with the following message:

System.Exception: Start of process C:\Tools\NUnit3\bin\nunit3-console.exe failed. The system cannot find the file specified
   at [email protected](String message) in 

Apparently, the tooling path has changed.

provide some utitlity to build exercises from CLI

For developers using linux it is quite uncommon to install a large IDE like xamarin/monodevelop. Especially this is true for small projects like exercism exercises.

Is it possible to provide a Makefile or something equivalent that makes compiling/running tests from bash possible?

triangle: incorrect test in some tracks

Please check if there's a test that states that a triangle with sides 2, 4, 2 is invalid. The triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side. If this doesn't affect this track, go ahead and just close the issue.

Verify "Largest Series Product" exercise implementation

There was some confusion in this exercise due to the ambiguous use of the term consecutive in the README. This could be taken to mean contiguous, as in consecutive by position, or as in consecutive numerically. The the README has been fixed (exercism/problem-specifications#200).

Please verify that the exercise is implemented in this track correctly (that it finds series of contiguous numbers, not series of numbers that follow each other consecutively).

If it helps, the canonical inputs/outputs for the exercise can be found here:
https://github.com/exercism/x-common/blob/master/largest-series-product.json

If everything is fine, go ahead and just close this issue. If there's something to be done, then please describe the steps needed in order to close the issue.

Create .NET Core/Visual Studio Code cross-platform setup instructions

Inspired by #38, esp. comments by @NobbZ and @ErikSchierboom -

I'm running .NET Core and Visual Studio Code on Ubuntu and it's a dream. Way nicer for doing exercism exercises than the ceremony and overkill of Visual Studio, and it's easily installed on Windows, OS X, and Linux... https://www.microsoft.com/net/core#linuxubuntu has dead simple instructions and ends with a link to download VS Code...

I think it might be well worth doing a cross-platform howto with a unified workflow, then have Visual Studio / Xamarin as an advanced/alternative option; VS and MonoDevelop are fine for people who are already using them, but with the amount of HALP! requests getting started w/ C# and/or F# on Gitter, streamlining the process with uniform, open-source tools (and without the heavyweight IDEs) seems like a good way to lower the barrier to entry for new users.

Pass explicit list of multiples in "Sum of Multiples" exercise rather than defaulting to 3 and 5

Hello, as part of exercism/problem-specifications#198 we'd like to make the sum of multiples exercise less confusing. Currently, the README specifies that if no multiples are given it should default to 3 and 5.

We'd like to remove this default, so that a list of multiples will always be specified by the caller. This makes the behavior explicit, avoiding surprising behavior and simplifying the problem.

Please make sure this track's tests for the sum-of-multiples problem do not expect such a default. Any tests that want to test behavior for multiples of [3, 5] should explicitly pass [3, 5] as the list of multiples.

After all tracks have completed this change, then exercism/problem-specifications#209 can be merged to remove the defaults from the README.

The reason we'd like this change to happen before changing the README is that it was very confusing for students to figure out the default behavior. It wasn't clear from simply looking at the tests that the default should be 3 and 5, as seen in exercism/exercism#2654, so some had to resort to looking at the example solutions (which aren't served by exercism fetch, so they have to find it on GitHub). It was added to the README to fix this confusion, but now we'd like to be explicit so we can remove the default line from the README.

You can find the common test data at https://github.com/exercism/x-common/blob/master/sum-of-multiples.json, in case that is helpful.

binary: improve tests for invalid numbers

We should have separate tests for:

  • alphabetic characters at the beginning of a valid binary number
  • alphabetic characters at the end of a valid binary number
  • alphabetic characters in the middle of an otherwise valid binary number
  • invalid digits (e.g. 2)

If the test suite for binary has test cases that cover these edge cases, this issue can safely be closed.

See exercism/problem-specifications#95

dominoes: ask for Chain rather than CanChain OR modify README to ask for CanChain

There are two possible ways to interpret the dominoes problem, as the canonical data tells us.

  1. Only ask for CanChain, a boolean telling us whether the given dominoes can be chained. The tests only need to check whether the boolean matches the expectation.
  2. Ask for Chain, which will be (I assume for C#) a valid chain if one exists, or null if one does not. The tests would need to check the various properties noted in the canonical data

This track asks for CanChain only. I assumed this was an intentional decision, so I did not question it. But Erik asked me to file an issue. So y'all can reopen the issue in case y'all want to ask for Chain.

clock: canonical test data has been improved

The JSON file containing canonical inputs/outputs for the Clock exercise has gotten new data.

There are two situations that the original data didn't account for:

  • Sometimes people perform computation/mutation in the display method instead of in add. This means that you might have two copies of clock that are identical, and if you add 1440 minutes to one and 2880 minutes to the other, they display the same value but are not equal.
  • Sometimes people only account for one adjustment in either direction, meaning that if you add 1,000,000 minutes, then the clock would not end up with a valid display time.

If this track has a generator for the Clock exercise, go ahead and regenerate it now. If it doesn't, then please verify the implementation of the test suite against the new data. If any cases are missing, they should be added.

See exercism/problem-specifications#166

C#: NUnit test suite not working with built in mono on OSX please read suggestion

The tests assertions are written in the constraint-based model (which is pretty neat!) BUT even the latest mono (3.12.1) comes with NUnit 2.4.8, and the tests just dont work in the constraint-based model for that version; I solved this by downloading the latest version of NUnit (2.6)
found here http://nunit.org/index.php?p=download

How to repro: just try to build the 1rst excercise on C#

naruse@MacBook-Pro ~/exercism/csharp/leap $:dmcs Leap.cs LeapTest.cs -reference:nunit.framework.dll
LeapTest.cs(9,40): error CS0103: The name Is' does not exist in the current context LeapTest.cs(16,40): error CS0103: The nameIs' does not exist in the current context
LeapTest.cs(23,40): error CS0103: The name Is' does not exist in the current context LeapTest.cs(30,40): error CS0103: The nameIs' does not exist in the current context

as you can see it throws an error regarding the Is class (which is part of NUnit).

My suggestion is to say at least that it in order for the tests to run, it needs to run on a NUnit version > 2.4 and this NUnit version doesnt come embebed in the latest mono (3.12.1). so its better to download a version of NUnit from the web page ;)

Replace [TestCase] tests with individual tests

We have several places where we use [TestCase] to create a single test with multiple input values. While efficient (no code duplication), this is not the best of user experiences as it makes it harder to run a single test and also doesn't really allow us to mark the various input values with a descriptive text. It also doesn't align with how canonical data for exercises is defined, which only works on single test cases.

Consider the isogram exercises's tests:

[TestCase("duplicates", ExpectedResult = true)]
[TestCase("eleven", ExpectedResult = false, Ignore = "Remove to run test case")]
[TestCase("subdermatoglyphic", ExpectedResult = true, Ignore = "Remove to run test case")]
[TestCase("Alphabet", ExpectedResult = false, Ignore = "Remove to run test case")]
[TestCase("thumbscrew-japingly", ExpectedResult = true, Ignore = "Remove to run test case")]
[TestCase("Hjelmqvist-Gryb-Zock-Pfund-Wax", ExpectedResult = true, Ignore = "Remove to run test case")]
[TestCase("Heizölrückstoßabdämpfung", ExpectedResult = true, Ignore = "Remove to run test case")]
[TestCase("the quick brown fox", ExpectedResult = false, Ignore = "Remove to run test case")]
[TestCase("Emily Jung Schwartzkopf", ExpectedResult = true, Ignore = "Remove to run test case")]
[TestCase("éléphant", ExpectedResult = false, Ignore = "Remove to run test case")]
public bool Isogram_correctly_detects_isograms(string input)
{
    return Isogram.IsIsogram(input);
}

What's the difference between test case one and two? It's not immediately obvious. The canonical-data of this exercise looks much nicer. I think we should convert the [TestCase] tests to individual tests.

Hamming exercis broken

When downloading Hamming I have this version (csharp):
(Test files differs aswell)

# Hamming

Write a program that can calculate the Hamming difference between two DNA strands.

A mutation is simply a mistake that occurs during the creation or
copying of a nucleic acid, in particular DNA. Because nucleic acids are
vital to cellular functions, mutations tend to cause a ripple effect
throughout the cell. Although mutations are technically mistakes, a very
rare mutation may equip the cell with a beneficial attribute. In fact,
the macro effects of evolution are attributable by the accumulated
result of beneficial microscopic mutations over many generations.

The simplest and most common type of nucleic acid mutation is a point
mutation, which replaces one base with another at a single nucleotide.

By counting the number of differences between two homologous DNA strands
taken from different genomes with a common ancestor, we get a measure of
the minimum number of point mutations that could have occurred on the
evolutionary path between the two strands.

This is called the 'Hamming distance'

    GAGCCTACTAACGGGAT
    CATCGTAATGACGGCCT
    ^ ^ ^  ^ ^    ^^

The Hamming distance between these two DNA strands is 7.


## Source

The Calculating Point Mutations problem at Rosalind [view source](http://rosalind.info/problems/hamm/)

In the web I see this version:

Hamming
Write a program that can calculate the Hamming difference between two DNA strands.

A mutation is simply a mistake that occurs during the creation or
copying of a nucleic acid, in particular DNA. Because nucleic acids are
vital to cellular functions, mutations tend to cause a ripple effect
throughout the cell. Although mutations are technically mistakes, a very
rare mutation may equip the cell with a beneficial attribute. In fact,
the macro effects of evolution are attributable by the accumulated
result of beneficial microscopic mutations over many generations.

The simplest and most common type of nucleic acid mutation is a point
mutation, which replaces one base with another at a single nucleotide.

By counting the number of differences between two homologous DNA strands
taken from different genomes with a common ancestor, we get a measure of
the minimum number of point mutations that could have occurred on the
evolutionary path between the two strands.

This is called the 'Hamming distance'

1
2
3
GAGCCTACTAACGGGAT
CATCGTAATGACGGCCT
^ ^ ^  ^ ^    ^^
The Hamming distance between these two DNA strands is 7.

Implementation notes
The Hamming distance is only defined for sequences of equal length. Hence you
may assume that only sequences of equal length will be passed to your hamming
distance function.

Source

The Calculating Point Mutations problem at Rosalind view source

rna-transcription: don't transcribe both ways

I can't remember the history of this, but we ended up with a weird non-biological thing in the RNA transcription exercise, where some test suites also have tests for transcribing from RNA back to DNA. This makes no sense.

If this track does have tests for the reverse transcription, we should remove them, and also simplify the reference solution to match.

If this track doesn't have any tests for RNA->DNA transcription, then this issue can be closed.

See exercism/problem-specifications#148

Use different output and input type parameters in Accumulate

The current example for the Accumulate exercise has the following method signature:

public static IEnumerable<T> Accumulate<T>(this IEnumerable<T> collection, Func<T, T> func)

This does not allow converting the type of sequence elements, like this:

"1 2 3 4".Split(' ').Accumulate(s => Convert.ToInt32(s)); // does not compile

Is this deliberate? If not, the method signature could be changed like this:

public static IEnumerable<U> Accumulate<T, U>(this IEnumerable<T> collection, Func<T, U> func)

What do you think?

If this is not deliberately being kept simple because it is an exercise for beginners, I could send a PR with the new method signature and a unit test.

Investigate track health and status of the track

I've used Sarah Sharp's FOSS Heartbeat project to generate stats for each of the language track repositories, as well as the x-common repository.

The Exercism heartbeat data is published here: https://exercism.github.io/heartbeat/

When looking at the data, please disregard any activity from me (kytrinyx), as I would like to get the language tracks to a point where they are entirely maintained by the community.

Please take a look at the heartbeat data for this track, and answer the following questions:

  • To what degree is the track maintained?
  • Who (if anyone) is merging pull requests?
  • Who (if anyone) is reviewing pull requests?
  • Is there someone who is not merging pull requests, but who comments on issues and pull requests, has thoughtful feedback, and is generally helpful? If so, maybe we can invite them to be a maintainer on the track.

I've made up the following scale:

  • ORPHANED - Nobody (other than me) has merged anything in the past year.
  • ENDANGERED - Somewhere between ORPHANED and AT RISK.
  • AT RISK - Two people (other than me) are actively discussing issues and reviewing and merging pull requests.
  • MAINTAINED - Three or more people (other than me) are actively discussing issues and reviewing and merging pull requests.

It would also be useful to know if there a lot of activity on the track, or just the occasional issue or comment.

Please report the current status of the track, including your best guess on the above scale, back to the top-level issue in the discussions repository: exercism/discussions#97

How to set up a local dev environment

See issue exercism/exercism#2092 for an overview of operation welcome contributors.


Provide instructions on how to contribute patches to the exercism test suites
and examples: dependencies, running the tests, what gets tested on Travis-CI,
etc.

The contributing document
in the x-api repository describes how all the language tracks are put
together, as well as details about the common metadata, and high-level
information about contributing to existing problems, or adding new problems.

The README here should be language-specific, and can point to the contributing
guide for more context.

From the OpenHatch guide:

Here are common elements of setting up a development environment you’ll want your guide to address:

Preparing their computer
Make sure they’re familiar with their operating system’s tools, such as the terminal/command prompt. You can do this by linking to a tutorial and asking contributors to make sure they understand it. There are usually great tutorials already out there - OpenHatch’s command line tutorial can be found here.
If contributors need to set up a virtual environment, access a virtual machine, or download a specific development kit, give them instructions on how to do so.
List any dependencies needed to run your project, and how to install them. If there are good installation guides for those dependencies, link to them.

Downloading the source
Give detailed instructions on how to download the source of the project, including common missteps or obstacles.

How to view/test changes
Give instructions on how to view and test the changes they’ve made. This may vary depending on what they’ve changed, but do your best to cover common changes. This can be as simple as viewing an html document in a browser, but may be more complicated.

Installation will often differ depending on the operating system of the contributor. You will probably need to create separate instructions in various parts of your guide for Windows, Mac and Linux users. If you only want to support development on a single operating system, make sure that is clear to users, ideally in the top-level documentation.

Move exercises to subdirectory

The problems api (x-api) now supports having exercises collected in a subdirectory
named exercises.

That is to say that instead of having a mix of bin, docs, and individual exercises,
we can have bin, docs, and exercises in the root of the repository, and all
the exercises collected in a subdirectory.

In other words, instead of this:

x{TRACK_ID}/
├── LICENSE
├── README.md
├── bin
│   └── fetch-configlet
├── bowling
│   ├── bowling_test.ext
│   └── example.ext
├── clock
│   ├── clock_test.ext
│   └── example.ext
├── config.json
└── docs
│   ├── ABOUT.md
│   └── img
... etc

we can have something like this:

x{TRACK_ID}/
├── LICENSE
├── README.md
├── bin
│   └── fetch-configlet
├── config.json
├── docs
│   ├── ABOUT.md
│   └── img
├── exercises
│   ├── bowling
│   │   ├── bowling_test.ext
│   │   └── example.ext
│   └── clock
│       ├── clock_test.ext
│       └── example.ext
... etc

This has already been deployed to production, so it's safe to make this change whenever you have time.

pov: Consider making tests insensitive to child ordering

I didn't actually do this exercise in C# so it's possible I misfired, but I think IsEqual does what I think it does.

In the pov tests, given a tree that must be reparented on node x, the tests ensure that the former parent of x comes after the former children of x.

Example: The graphs:

    private static readonly Graph<string> kids =
        Pov.CreateGraph("root", new[] {
            Pov.CreateGraph(x, new[] {
                Pov.CreateGraph("kid-0", new Graph<string>[0]),
                Pov.CreateGraph("kid-1", new Graph<string>[0])
            })
    });
    private static readonly Graph<string> kids_ = 
        Pov.CreateGraph(x, new[] {
            Pov.CreateGraph("kid-0", new Graph<string>[0]),
            Pov.CreateGraph("kid-1", new Graph<string>[0]),
            Pov.CreateGraph("root", new Graph<string>[0])
    });

However, you could imagine that the following ordering is equally valid - it doesn't matter whether the root becomes the last child or the first child!

    private static readonly Graph<string> kids_ = 
        Pov.CreateGraph(x, new[] {
            Pov.CreateGraph("root", new Graph<string>[0]),
            Pov.CreateGraph("kid-0", new Graph<string>[0]),
            Pov.CreateGraph("kid-1", new Graph<string>[0])
    });

I think it would be beneficial if the tests did not care about the ordering of the children, since trees probably don't care about the ordering of their children, and it almost certainly is valid to allow either order in the POV problem.

Yes, I did copy a lot of this text from exercism/haskell#92, sorry. But it is definitely still relevant to this track. If you care to see how I did in Haskell, I test sorted edge list + root, so that child ordering does not matter: exercism/haskell#108

Verify that nothing links to help.exercism.io

The old help site was deprecated in December 2015. We now have content that is displayed on the main exercism.io website, under each individual language on http://exercism.io/languages.

The content itself is maintained along with the language track itself, under the docs/ directory.

We decided on this approach since the maintainers of each individual language track are in the best position to review documentation about the language itself or the language track on Exercism.

Please verify that nothing in docs/ refers to the help.exercism.io site. It should instead point to http://exercism.io/languages/:track_id (at the moment the various tabs are not linkable, unfortunately, we may need to reorganize the pages in order to fix that).

Also, some language tracks reference help.exercism.io in the SETUP.md file, which gets included into the README of every single exercise in the track.

We may also have referenced non-track-specific content that lived on help.exercism.io. This content has probably been migrated to the Contributing Guide of the x-common repository. If it has not been migrated, it would be a great help if you opened an issue in x-common so that we can remedy the situation. If possible, please link to the old article in the deprecated help repository.

If nothing in this repository references help.exercism.io, then this can safely be closed.

How to run the tests?

After I encountered #44, I simply removed all the Ignore things and tried to run. But then I do get an errormessage that I need to have an executable project. So how can I set up MS VS to actually run the tests instead of trying to run the projects executable?

Update config.json to match new specification

For the past three years, the ordering of exercises has been done based on gut feelings and wild guesses. As a result, the progression of the exercises has been somewhat haphazard.

In the past few months maintainers of several tracks have invested a great deal of time in analyzing what concepts various exercises require, and then reordering the tracks as a result of that analysis.

It would be useful to bake this data into the track configuration so that we can adjust it over time as we learn more about each exercise.

To this end, we've decided to add a new key exercises in the config.json file, and deprecate the problems key.

See exercism/discussions#60 for details about this decision.

Note that we will not be removing the problems key at this time, as this would break the website and a number of tools.

The process for deprecating the old problems array will be:

  • Update all of the track configs to contain the new exercises key, with whatever data we have.
  • Simultaneously change the website and tools to support both formats.
  • Once all of the tracks have added the exercises key, remove support for the old key in the site and tools.
  • Remove the old key from all of the track configs.

In the new format, each exercise is a JSON object with three properties:

  • slug: the identifier of the exercise
  • difficulty: a number from 1 to 10 where 1 is the easiest and 10 is the most difficult
  • topics: an array of strings describing topics relevant to the exercise. We maintain
    a list of common topics at https://github.com/exercism/x-common/blob/master/TOPICS.txt. Do not feel like you need to restrict yourself to this list;
    it's only there so that we don't end up with 20 variations on the same topic. Each
    language is different, and there will likely be topics specific to each language that will
    not make it onto the list.

The difficulty rating can be a very rough estimate.

The topics array can be empty if this analysis has not yet been done.

Example:

"exercises": [
  {
    "slug": "hello-world" ,
    "difficulty": 1,
    "topics": [
        "control-flow (if-statements)",
        "optional values",
        "text formatting"
    ]
  },
  {
    "difficulty": 3,
    "slug": "anagram",
    "topics": [
        "strings",
        "filtering"
    ]
  },
  {
    "difficulty": 10,
    "slug": "forth",
    "topics": [
        "parsing",
        "transforming",
        "stacks"
    ]
  }
]

It may be worth making the change in several passes:

  1. Add the exercises key with the array of objects, where difficulty is 1 and topics is empty.
  2. Update the difficulty settings to reflect a more accurate guess.
  3. Add topics (perhaps one-by-one, in separate pull requests, in order to have useful discussions about each exercise).

scrabble-score: replace 'multibillionaire' with 'oxyphenbutazone'

The word multibillionaire is too long for the scrabble board. Oxyphenbutazone, on the other hand, is legal.

Please verify that there is no test for multibillionaire in the scrabble-score in this track. If the word is included in the test data, then it should be replaced with oxyphenbutazone. Remember to check the case (if the original is uppercase, then the replacement also should be).

If multibillionaire isn't used, then this issue can safely be closed.

See exercism/problem-specifications#86

Incorrect HTML tags for bold text in the tests for Markdown

I think the following test for the Markdown exercise expects the wrong tags:

[Test]
public void Parsing_bold_text()
{
    var input = "__This will be bold__";
    var expected = "<p><em>This will be bold</em></p>";
    Assert.That(Markdown.Parse(input), Is.EqualTo(expected));
}

The <em> tag is rendered as italic text by default, so I think the correct tag here would be:

  • either <b> (to match the <i> tag in the test for italic)
  • or <strong>, but then the <i> tag in the italic test case should also be changed to <em>.

I think the latter option is the better one because em and strong are semantic tags.

The test case Mixed_normal_italics_and_bold_text should also be updated in both cases.

If you agree, I can send a PR that updates the tests and the example.

Use default file

Some tracks lessen the barrier for users by providing an empty implementation file, which prevents the user from having to create the file themselves. An example of such a track is the Elm track, but the Scala track is also discussing this. How do you all feel about this? I think it would indeed lower the barrier, especially if we will also be providing exercise-specifc .csproj files.

Create project for each exercise

To help users get started programming, we should provide the user with a skeleton .csproj file. This .csproj file should work with the .NET CLI and run on .NET Core.

'NUnit.Framework.IgnoreAttribute' does not contain a constructor that takes 0 arguments

Hi there!

When trying to do the leap-exercise, I am confronted with the following error:

'NUnit.Framework.IgnoreAttribute' does not contain a constructor that takes 0 arguments

It is repeating in lines 12, 19, and 26 of LeapTes.cs.

I am using MSVS 2013 CE

and have the following packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="NUnit.Console" version="3.0.1" />
  <package id="NUnit.Runners" version="3.0.1" />
</packages>

Since the NUnit.Runners now does show as "NUnit Console Version 3" when searching I do think it is a versioning issue with NUnit. Could you please provide a proper Version selector in the documentation or update the track to NUnit 3?

Create test data generators

The canonical data of the various exercises regularly receives updates. Some of our exercises will be using outdated or incomplete data. We should try to fix this by writing test generators, support for which is added in #228.

Using link to outdated version of NUnit Adapter causes tests to not be found

In the section for "Create a New Visual Studio" there is a link to install the NUnit Test Adapter, here is the link given: https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d

I also followed the steps of the Nuget Package Manager for Solution, and grabbed the latest NUnit.

This led to me installing version 2.0 of the Test Adapter but version 3.x of the NUnit framework. These are not compatible and the symptom is that your tests just don't appear in the test explorer.

You can see an example of someone having this issue here: http://stackoverflow.com/a/35057937/23933

I feel the documentation would be improved by updating the link and offering a short caution to ensure the versions are the same.

Here is the update url for the 3.0 version of the Test Adapter: https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d

Copy track icon into language track repository

Right now all of the icons used for the language tracks (which can be seen at http://exercism.io/languages) are stored in the exercism/exercism.io repository in public/img/tracks/. It would make a lot more sense to keep these images along with all of the other language-specific stuff in each individual language track repository.

There's a pull request that is adding support for serving up the track icon from the x-api, which deals with language-specific stuff.

In order to support this change, each track will need to

In other words, at the end of it you should have the following file:

./img/icon.png

See exercism/exercism#2925 for more details.

Meetup - 5th Monday

There is an interesting edge case in the meetup problem:
some months have five Mondays.

March of 2015 has five Mondays (the fifth being March 30th), whereas
February of 2015 does not, and so should produce an error.


Thanks, @JKesMc9tqIQe9M for pointing out the edge case.
See exercism.io#2142.

Enhance description on how to set up Xamarin/monodevelop on Mac OSX/Linux

I wanted to try some C# exercises in Xamarin until we have a solution for #37, but I am not able to open the actual exercise as a project in it. Xamarin wants to create some additional subfolders with subprojects in it.

I haven't find a way to import exercism files as exisitng sources.

Also there are 2 images on the description regarding set up/testrunning on Mac, but they don't show up/ don't load.

Changes to Bowling tests

We recently rewrote the test suite for Bowling. Since this track implements Bowling, please take a look at the new canonical_data.json file and see if your track should update its implementation or tests.

The new test suite reorders tests so that students can get to green quickly. It also reduces the number of tests so that students can focus on solving the interesting edge cases.

More details on this change are available in this issue

Replace NUnit with Xunit

Xunit has slowly but steadily been replacing NUnit as the favored testing framework. Virtually all open-source Microsoft code now uses Xunit as the unit-testing framework. The integration with .NET Core is thus also better, as Microsoft has invested in Xunit for its own software and thus has to keep it running. An example of this improved integration is the fact that there is an Xunit template available in the .NET CLI.

p.s. I'm already working on this :)

Implement C# exercises

Copied from exercism/exercism#1125


To implement C# in a lightweight manner, we need to sidestep creating a project file for every exercise. Using a project also makes it difficult to port to various platforms.

Setup

Linux

TBD

Mac

dmcs Bob.cs BobTest.cs /r:/Users/burtlo/Downloads/NUnit-2.6.3/bin/nunit.framework.dll -target:library
monolinker -a /Users/burtlo/Downloads/NUnit-2.6.3/bin/nunit.framework.dll -a Bob.dll
mono /Users/burtlo/Downloads/NUnit-2.6.3/bin/nunit-console.exe output/Bob.dll
  • Clean up
rm -rf output

Windows

TBD

Minimum Exercises to Implement

The following exercises are required to be created for the path to be launch.

  • bob
  • hamming
  • word-count
  • anagram
  • nucleotide-count
  • phone-number
  • grade-school
  • robot-name
  • leap
  • etl

Additional Exercises to Implement

After the initial set of exercises the following should be implemented to have a more complete test suite.

  • meetup
  • twelve-days
  • space-age
  • gigasecond
  • triangle
  • scrabble-score
  • roman-numerals
  • binary
  • prime-factors
  • raindrops
  • allergies
  • strain
  • atbash-cipher
  • accumulate
  • crypto-square
  • trinary
  • rna-transcription
  • sieve
  • simple-cipher
  • octal
  • luhn
  • pig-latin
  • pythagorean-triplet
  • series
  • difference-of-squares
  • secret-handshake
  • wordy
  • hexadecimal
  • largest-series-product
  • kindergarten-garden
  • binary-search-tree
  • matrix
  • robot-simulator
  • nth-prime
  • palindrome-products
  • pascals-triangle
  • beer-song
  • sum-of-multiples
  • queen-attack
  • saddle-points
  • ocr-numbers
  • simple-linked-list
  • linked-list

Test Error in Exercise "Book Store"

The test "Basket_with_eight_books" tests for a sum value of "51.20", when the correct sum should be "51.60".

E.G: books=[1,1,2,2,3,3,4,5]
groups=[count(1,2,3,4,5),count(1,2,3)]=[5,3]
discount[5]=.75
discount[3]=.9
groups8=[40,24]
groups
8discount=[40.75,24*.9]=[30,21.6]
total=30+21.6=51.60

This particular example also happens to be contained in the Readme for the exercise, but the arithmetic was done correctly there.

Delete configlet binaries from history?

I made a really stupid choice a while back to commit the cross-compiled
binaries for configlet (the tool that sanity-checks the config.json
against the implemented problems) into the repository itself.

Those binaries are HUGE, and every time they change the entire 4 or 5 megs get
recommitted. This means that cloning the repository takes a ridiculously long
time.

I've added a script that can be run on travis to grab the latest release from
the configlet repository (bin/fetch-configlet), and travis is set up to run
this now instead of using the committed binary.

I would really like to thoroughly delete the binaries from the entire git
history, but this will break all the existing clones and forks.

The commands I would run are:

# ensure this happens on an up-to-date master
git checkout master && git fetch origin && git reset --hard origin/master

# delete from history
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch bin/configlet-*' --prune-empty

# clean up
rm -rf .git/refs/original/
git reflog expire --all
git gc --aggressive --prune

# push up the new master, force override existing master branch
git push -fu origin master

If we do this everyone who has a fork will need to make sure that their master
is reset to the new upstream master:

git checkout master
git fetch upstream master
git reset --hard upstream/master
git push -fu origin master

We can at-mention (@) all the contributors and everyone who has a fork here in this
issue if we decide to do it.

The important question though, is: Is it worth doing?

Do you have any other suggestions of how to make sure this doesn't confuse people and break their
repository if we do proceed with this change?

Launch C# track!

@dinkelburt I've added you as a committer on the C# team. Thanks so much for porting all those exercises!

In order to launch the track officially we're going to need:

  • a getting started with C# page
  • a way to recognize submissions as C#
  • an ordered list of exercises
  • a submodule in x-api
  • list csharp in the active languages on exercism.io

I've got the last four covered, but the help page is going to be tricky. @dinkelburt would you be willing to give that one a shot? There's some detail in #2 but I don't have the background necessary to evaluate whether or not it's going to make sense :)

We'll also need people to nitpick the C# track. That shouldn't be too difficult, since it's a popular language (I'm more worried about Rust and other niche languages).

See the exercism.io CONTRIBUTING.md file for details.

bank-account: Should GetBalance be a Balance property instead?

When I was doing this exercise, I remarked that it seemed unidiomatic that GetBalance() was a method, rather than having a Balance property.

But y'all know C# better than I do, so y'all are in a better position to answer - must it be a method? Or can/should it be a property?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.