Exemplo n.º 1
0
        public void AccountOrganization_MustNotBeEqualToNull()
        {
            var jp1 = new JuridicalPerson(new LegalForm("ООО", EconomicAgentType.JuridicalPerson))
            {
                Id = 1
            };
            var org1 = new AccountOrganization("Тест1", "Тест1", jp1)
            {
                Id = 5
            };
            AccountOrganization accountOrganizationNull = null;

            Assert.IsFalse(org1.Equals(accountOrganizationNull));
            Assert.IsFalse(org1.Equals(null));
        }
Exemplo n.º 2
0
        public void AccountOrganization_MustNotBeEqualToNonAccountOrganization()
        {
            var jp1 = new JuridicalPerson(new LegalForm("ООО", EconomicAgentType.JuridicalPerson))
            {
                Id = 1
            };
            var org1 = new AccountOrganization("Тест1", "Тест1", jp1)
            {
                Id = 5
            };
            DateTime nonAccountOrganization = new DateTime(2007, 12, 5);

            Assert.IsFalse(org1.Equals(nonAccountOrganization));
        }
Exemplo n.º 3
0
        public void AccountOrganization_DifferentIdMustHaveEqualsFalse()
        {
            var jp1 = new JuridicalPerson(new LegalForm("ООО", EconomicAgentType.JuridicalPerson))
            {
                Id = 1
            };
            var org1 = new AccountOrganization("Тест", "Тест", jp1)
            {
                Id = 5
            };
            var org2 = new AccountOrganization("Тест", "Тест", jp1)
            {
                Id = 6
            };

            Assert.IsFalse(org1.Equals(org2));
            Assert.IsFalse(org2.Equals(org1));
        }
Exemplo n.º 4
0
        public void AccountOrganization_SameIdMustHaveEqualsTrue()
        {
            var jp1 = new JuridicalPerson(new LegalForm("ООО", EconomicAgentType.JuridicalPerson))
            {
                Id = 1
            };
            var org1 = new AccountOrganization("Тест1", "Тест1", jp1)
            {
                Id = 5
            };
            var jp2 = new JuridicalPerson(new LegalForm("ООО", EconomicAgentType.JuridicalPerson))
            {
                Id = 2
            };
            var org2 = new AccountOrganization("Тест", "Тест2", jp2)
            {
                Id = 5
            };

            Assert.IsTrue(org1.Equals(org2));
            Assert.IsTrue(org2.Equals(org1));
        }