Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
class MyDto
{
public string key {get; private set;}
public int value {get; private set;}
public MyDto(string key, int value)
{
this.key = key;
this.value = value;
}
public override int GetHashCode()
{
//assumes get will never be null. value has a default value of 0 so nulls are not an issue.
return key.GetHashCode() ^ 37 + value.GetHashCode();
}
public override boll Equals(object other)
{
if(ReferenceEquals(null, other)) return false;
if(ReferenceEquals(this, other)) return true;
return other.GetType() == typeof(MyDto)
&& other.key == key
&& other.value == value;
}
}
var first = get_list_of_mydtos();
var second = get_another_list_of_mydtos();
foreach(var f in first)
{
if(second.Contains(f)) yield return f;
}
foreach(var s in second)
{
if(first.Contains(s)) yield return s;
}
bool isEqual = true;
foreach (KeyValuePair<string, int> kvpExpected in expected)
{
isEqual = output.Contains(kvpExpected);
}
Assert.IsTrue(isEqual);