public void TypesShouldSerialize() { var productId = ProductId.New(); var s = JsonConvert.SerializeObject(productId); var newId = JsonConvert.DeserializeObject <ProductId>(s); Assert.Equal((object)productId, (object)newId); }
public void Test_New() { var id = ProductId.New(); Assert.NotEqual(Guid.Empty, (Guid)id); var id2 = id; Assert.Equal(id2, id); Assert.True(id2 == id); Assert.NotEqual(ProductId.New(), id); Assert.True(ProductId.New() != id); }
public void TypesShouldRemainPrimitive() { var productId = ProductId.New(); Assert.True(typeof(ProductId).IsValueType); }
public Product(string name) { Id = ProductId.New(); Name = name; }