public void Serialization_PersistsArguments_NullClass() { PageInfo sourceEntry = new PageInfo("Page Name", (ClassState)null); byte[] data = SerializationHelper.SerializeToArray(sourceEntry); PageInfo newEntry = SerializationHelper.DeserializeFromArray <PageInfo>(data); Assert.Equal(null, newEntry.GetArguments <ClassState>()); }
public void Serialization_PersistsArguments_NullReturnsDefaultInt() { PageInfo sourceEntry = new PageInfo("Page Name", null); byte[] data = SerializationHelper.SerializeToArray(sourceEntry); PageInfo newEntry = SerializationHelper.DeserializeFromArray <PageInfo>(data); Assert.Equal(0, newEntry.GetArguments <int>()); }
public void Serialization_PersistsArguments_String() { PageInfo sourceEntry = new PageInfo("Page Name", "Arguments"); byte[] data = SerializationHelper.SerializeToArray(sourceEntry); PageInfo newEntry = SerializationHelper.DeserializeFromArray <PageInfo>(data); Assert.Equal("Arguments", newEntry.GetArguments <string>()); }
public void Constructor_SetsArguments_Struct() { PageInfo navigationEntry = new PageInfo("Page Name", new StructState() { Text = "Text Value", Number = 42 }); var args = navigationEntry.GetArguments <StructState>(); Assert.Equal("Text Value", args.Text); Assert.Equal(42, args.Number); }
public void Serialization_PersistsArguments_Struct() { PageInfo sourceEntry = new PageInfo("Page Name", new StructState() { Text = "Text Value", Number = 42 }); byte[] data = SerializationHelper.SerializeToArray(sourceEntry); PageInfo newEntry = SerializationHelper.DeserializeFromArray <PageInfo>(data); var args = newEntry.GetArguments <StructState>(); Assert.Equal("Text Value", args.Text); Assert.Equal(42, args.Number); }
public void Constructor_SetsArguments_NullReturnsDefaultInt() { PageInfo navigationEntry = new PageInfo("Page Name", null); Assert.Equal(0, navigationEntry.GetArguments <int>()); }
public void Constructor_SetsArguments_NullClass() { PageInfo navigationEntry = new PageInfo("Page Name", (ClassState)null); Assert.Equal(null, navigationEntry.GetArguments <ClassState>()); }
public void Constructor_SetsArguments_Int() { PageInfo navigationEntry = new PageInfo("Page Name", 42); Assert.Equal(42, navigationEntry.GetArguments <int>()); }
public void Constructor_SetsArguments_NullString() { PageInfo navigationEntry = new PageInfo("Page Name", (string)null); Assert.Equal(null, navigationEntry.GetArguments <string>()); }
public void Constructor_SetsArguments_String() { PageInfo navigationEntry = new PageInfo("Page Name", "Arguments"); Assert.Equal("Arguments", navigationEntry.GetArguments <string>()); }