public void TestProjectableNotText() { var textState = "test-state"; var state = new BinaryState("123", typeof(string), 1, Encoding.UTF8.GetBytes(textState), 1, Metadata.With("value", "op")); var projectable = new BinaryProjectable(state, Enumerable.Empty <IEntry>(), "p123"); Assert.Throws <NotImplementedException>(() => projectable.DataAsText()); }
public void TestProjectableness() { var textState = "test-state"; var state = new BinaryState("123", typeof(string), 1, Encoding.UTF8.GetBytes(textState), 1, Metadata.With("value", "op")); var projectable = new BinaryProjectable(state, Enumerable.Empty <IEntry>(), "p123"); Assert.Equal("op", projectable.BecauseOf()[0]); Assert.Equal(Encoding.UTF8.GetBytes(textState), projectable.DataAsBytes()); Assert.Equal("123", projectable.DataId); Assert.Equal(1, projectable.DataVersion()); Assert.Equal("value", projectable.Metadata); Assert.Equal("p123", projectable.ProjectionId); Assert.Equal(typeof(String).AssemblyQualifiedName, projectable.Type); Assert.Equal(1, projectable.TypeVersion); }