Exemplo n.º 1
0
        public void CorrectToString()
        {
            var mattiasAsplund =
                new Part("Mattias Asplund", "19710405-7851");
            var someCompany = new Part("Mattias Asplund AB", "556599-5239");
            var sut         = new Accountibility(someCompany, mattiasAsplund, "VD");

            Assert.AreEqual("Mattias Asplund, VD på Mattias Asplund AB",
                            sut.ToString());
        }
Exemplo n.º 2
0
        public void TwoParts()
        {
            var sut      = new PartSystem();
            var p1       = new Part("A", "1");
            var p2       = new Part("B", "2");
            var vd       = new Accountibility(p1, p2, "VD");
            var employer = new Accountibility(p2, p1, "Arbetsgivare");

            sut.AddPart(p1);
            sut.AddPart(p2);
            sut.AddAccountibility(vd);
            sut.AddAccountibility(employer);
            int actual = sut.NumberOfParts;

            Assert.AreEqual(2, actual);
            actual = sut.NumberOfAccountabilites;
            Assert.AreEqual(2, actual);
        }
Exemplo n.º 3
0
        public void ResponsibilitiesForGivenPart()
        {
            var sut      = new PartSystem();
            var p1       = new Part("A", "1");
            var p2       = new Part("B", "2");
            var vd       = new Accountibility(p1, p2, "VD");
            var employer = new Accountibility(p2, p1, "Arbetsgivare");

            sut.AddPart(p1);
            sut.AddPart(p2);
            sut.AddAccountibility(vd);
            sut.AddAccountibility(employer);
            List <Accountibility> accability = sut.ResponsibilitesByParty(p2);

            foreach (var acc in accability)
            {
                Debug.WriteLine(acc.ToString());
            }
            Assert.AreEqual(1, accability.Count);
        }