コード例 #1
0
        public void FullConstructor(string name, int salary, FatCat parent)
        {
            WageSlave wageSlave = new WageSlave(name, salary, parent);

            Assert.Equal(name, wageSlave.GetName());
            Assert.Equal(salary, wageSlave.GetSalary());
            Assert.Equal(parent, wageSlave.GetParent());
            Assert.True(wageSlave.HasParent(), "HasParent() did not return true when constructed with an owner");
        }
コード例 #2
0
        public void NoOwnerConstructor(string name, int salary)
        {
            WageSlave wageSlave = new WageSlave(name, salary);

            Assert.Equal(name, wageSlave.GetName());
            Assert.Equal(salary, wageSlave.GetSalary());
            Assert.Null(wageSlave.GetParent());
            Assert.False(wageSlave.HasParent(), "HasParent() did not return false when constructed without an owner");
        }