コード例 #1
0
        public void Text_Set_Get()
        {
            var sign = new SerializableSign();

            sign.Text = "test";

            Assert.Equal("test", sign.Text);
        }
コード例 #2
0
        public void Y_Set_Get()
        {
            var sign = new SerializableSign();

            sign.Y = 100;

            Assert.Equal(100, sign.Y);
        }
コード例 #3
0
        public void X_Set_Get()
        {
            var sign = new SerializableSign();

            sign.X = 256;

            Assert.Equal(256, sign.X);
        }
コード例 #4
0
        public void Index_Set_Get()
        {
            var sign = new SerializableSign();

            sign.Index = 5;

            Assert.Equal(5, sign.Index);
        }
コード例 #5
0
        public void Read()
        {
            var length = SerializableSign.Read(_bytes, out var sign);

            Assert.Equal(_bytes.Length, length);

            Assert.Equal(5, sign.Index);
            Assert.Equal(256, sign.X);
            Assert.Equal(100, sign.Y);
            Assert.Equal("test", sign.Text);

            var bytes2  = new byte[1000];
            var length2 = sign.Write(bytes2);

            Assert.Equal(length, length2);
            Assert.Equal(_bytes, bytes2[..length2]);
コード例 #6
0
        public void Name_SetNullValue_ThrowsArgumentNullException()
        {
            var sign = new SerializableSign();

            Assert.Throws <ArgumentNullException>(() => sign.Text = null !);
        }
コード例 #7
0
        public void Name_GetNullValue()
        {
            var sign = new SerializableSign();

            Assert.Equal(string.Empty, sign.Text);
        }