C#

Basics

Code snippets

Lists & enums

// Initialize a List with some values
var foobar = new List<BobEnums.CategoryValue> { BobEnums.CategoryValue.ObjectStories, BobEnums.CategoryValue.ObjectActivities };
// Iterate through all the possible values of an enum
foreach (BobEnums.CategoryValue categoryValue in Enum.GetValues(typeof(BobEnums.CategoryValue)))) {
    Assert.AreEqual(someMethod(categoryValue), foobar.Contains(categoryValue));
}

Dictionnary

The Add method throws an exception if the key already exists.

Print/export