コード例 #1
0
        public void Serialization_ValueTypePhase2()
        {
            ValueTypeTestData data = new ValueTypeTestData(4);

            object copy = SerializationManager.RoundTripSerializationForTesting(data);

            Assert.IsInstanceOfType(copy, typeof(ValueTypeTestData), "Deserialized result is of wrong type");
            Assert.AreEqual <int>(4, ((ValueTypeTestData)copy).GetValue(), "Deserialized result is incorrect");
        }
コード例 #2
0
        public void Serialization_ValueTypePhase2()
        {
            ValueTypeTestData data = new ValueTypeTestData(4);

            object copy = SerializationManager.RoundTripSerializationForTesting(data);

            Assert.IsAssignableFrom <ValueTypeTestData>(copy);
            Assert.Equal <int>(4, ((ValueTypeTestData)copy).GetValue());
        }
コード例 #3
0
        public void Serialization_ValueTypePhase1()
        {
            ValueTypeTestData data = new ValueTypeTestData(4);

            object obj = SerializationManager.DeepCopy(data);

            Assert.IsInstanceOfType(obj, typeof(ValueTypeTestData), "Deserialized result is of wrong type");
            Assert.AreEqual <int>(4, ((ValueTypeTestData)obj).GetValue(), "Deserialized result is incorrect");
        }
コード例 #4
0
ファイル: SerializationTests.cs プロジェクト: jdom/orleans
        public void Serialization_ValueTypePhase2()
        {
            ValueTypeTestData data = new ValueTypeTestData(4);

            object copy = SerializationManager.RoundTripSerializationForTesting(data);

            Assert.IsAssignableFrom<ValueTypeTestData>(copy);
            Assert.Equal<int>(4, ((ValueTypeTestData)copy).GetValue());
        }
コード例 #5
0
        public void Serialization_ValueTypePhase1()
        {
            ValueTypeTestData data = new ValueTypeTestData(4);

            object obj = SerializationManager.DeepCopy(data);

            Assert.IsAssignableFrom <ValueTypeTestData>(obj);
            Assert.Equal <int>(4, ((ValueTypeTestData)obj).GetValue());
        }
コード例 #6
0
ファイル: SerializationTests.cs プロジェクト: jdom/orleans
        public void Serialization_ValueTypePhase1()
        {
            ValueTypeTestData data = new ValueTypeTestData(4);

            object obj = SerializationManager.DeepCopy(data);

            Assert.IsAssignableFrom<ValueTypeTestData>(obj);
            Assert.Equal<int>(4, ((ValueTypeTestData)obj).GetValue());
        }
コード例 #7
0
        public void Serialization_ValueTypePhase2()
        {
            ValueTypeTestData data = new ValueTypeTestData(4);

            object copy = SerializationManager.RoundTripSerializationForTesting(data);

            Assert.IsInstanceOfType(copy, typeof(ValueTypeTestData), "Deserialized result is of wrong type");
            Assert.AreEqual<int>(4, ((ValueTypeTestData)copy).GetValue(), "Deserialized result is incorrect");
        }
コード例 #8
0
        public void Serialization_ValueTypePhase1()
        {
            ValueTypeTestData data = new ValueTypeTestData(4);

            object obj = SerializationManager.DeepCopy(data);

            Assert.IsInstanceOfType(obj, typeof(ValueTypeTestData), "Deserialized result is of wrong type");
            Assert.AreEqual<int>(4, ((ValueTypeTestData)obj).GetValue(), "Deserialized result is incorrect");
        }
コード例 #9
0
        public async Task Generic_GrainWithValueTypeState()
        {
            Guid id    = Guid.NewGuid();
            var  grain = this.GrainFactory.GetGrain <IValueTypeTestGrain>(id);

            var initial = await grain.GetStateData();

            Assert.Equal(new ValueTypeTestData(0), initial);

            var expectedValue = new ValueTypeTestData(42);

            await grain.SetStateData(expectedValue);

            Assert.Equal(expectedValue, await grain.GetStateData());
        }
コード例 #10
0
 public Task SetStateData(ValueTypeTestData d)
 {
     State.StateData = d;
     return(TaskDone.Done);
 }