I alayws! have to search for this thing and figured it would be a blessing for somebody else out there too!
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class Dictionary {
public static int Upsert() {
Dictionary<string, int> dictionary = new Dictionary<string, int>();
dictionary["upsert"] = dictionary.GetValueOrDefault("uspert", 0) + 1;
return dictionary["upsert"];
}
}
namespace Solution {
using NUnit.Framework;
using System;
// TODO: Replace examples and use TDD by writing your own tests
[TestFixture]
public class SolutionTest
{
[Test]
public void Dictionary_Upsert()
{
Assert.AreEqual(1, Dictionary.Upsert());
}
}
}