public void EqualityTest()
        {
            var money1 = new TestMoneyType(10, TestCurrencyEnum.Gel);
            var money2 = new TestMoneyType(10, TestCurrencyEnum.Gel);
            Assert.AreEqual(money1,money2);

            var command1 = new TestCommand(money1, "Georgial lari");
            var command2 = new TestCommand(money2, "Georgial lari");
            Assert.AreEqual(command1, command2);
        }
Beispiel #2
0
        public void EqualityTest()
        {
            var money1 = new TestMoneyType(10, TestCurrencyEnum.Gel);
            var money2 = new TestMoneyType(10, TestCurrencyEnum.Gel);

            Assert.AreEqual(money1, money2);

            var command1 = new TestCommand(money1, "Georgial lari");
            var command2 = new TestCommand(money2, "Georgial lari");

            Assert.AreEqual(command1, command2);
        }
Beispiel #3
0
 public bool Equals(TestMoneyType other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other._amount == _amount && Equals(other._currency, _currency));
 }
        public void SerializeDeserializeTest()
        {
            var money1 = new TestMoneyType(10, TestCurrencyEnum.Gel);
            var command1 = new TestCommand(money1, "Georgial lari");

            var formatter = new SoapFormatter();

            Stream strem = new MemoryStream();

            formatter.Serialize(strem, command1);
            strem.Seek(0, SeekOrigin.Begin);
            byte[] buf = new byte[strem.Length];
            var s = strem.Read(buf, 0, (int)strem.Length);

            var command2 = formatter.Deserialize(strem).As<TestCommand>();

            strem.Close();

            Assert.AreEqual(command1, command2);
        }
Beispiel #5
0
        public void SerializeDeserializeTest()
        {
            var money1   = new TestMoneyType(10, TestCurrencyEnum.Gel);
            var command1 = new TestCommand(money1, "Georgial lari");


            var formatter = new SoapFormatter();

            Stream strem = new MemoryStream();

            formatter.Serialize(strem, command1);
            strem.Seek(0, SeekOrigin.Begin);
            byte[] buf = new byte[strem.Length];
            var    s   = strem.Read(buf, 0, (int)strem.Length);

            var command2 = formatter.Deserialize(strem).As <TestCommand>();

            strem.Close();

            Assert.AreEqual(command1, command2);
        }
Beispiel #6
0
 public TestCommand(TestMoneyType money, string name)
 {
     _money = money;
     _name  = name;
 }
 public TestCommand(TestMoneyType money, string name)
 {
     _money = money;
     _name = name;
 }
 public bool Equals(TestMoneyType other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other._amount == _amount && Equals(other._currency, _currency);
 }