I'm running into some issues when writing a new unit test. My comments in the code example explain my specific issue:
KeyboardLayout layout
= Engine.ParseLayout(Dimensions.Create(300, 300), "FooBar", provider);
var dweeb = layout.Layout.SelectMany(t => t);
//Parsed layout is not a mutant
Assert.IsTrue(!layout.IsMutant);
KeyboardLayout newLayout = StandardKeyboardMutations.MutateKeyboard(layout);
var newb = newLayout.Layout.SelectMany(t => t);
//I don't understand why this test fails. They should be stored in seperate memeory locations and therefore not equal by reference comparison.
//Unless of course saying var x = foo doesn't always provide a fresh memory location for the value of foo.
Assert.AreNotEqual(layout, newLayout);
this line Assert.AreNotEqual(layout, newLayout);
always fails.
I don't know why I've been making this assumption (stated in comments) up until now: Declaring a variable always executes a store procedure to a fresh memory location. (one not being used by a currently running program).
To be clear, the question is, in c#, does var x = foo;
always use a fresh memory cell? If not, what is the criteria for using one? Or maybe it always stores in x the address of the value? Or have I missed something and I am asking the wrong question entirely to the find what is wrong here?
This is my first "official" unit testing experience, Thanks in advance.