public void CanGetByCode()
        {
            DistributorRepository dRepos = new DistributorRepository(Config.GrundfosFactoryConfigPath);

            DistributorController dc = new DistributorController(dRepos);
            Distributor           d  = dc.GetByCode("000001");

            Assert.AreEqual(d.Code, "000001");
        }
Exemplo n.º 2
0
        public void CanGetByCode()
        {
            MockRepository         mock        = new MockRepository();
            IDistributorRepository mockedRepos = mock.CreateMock <IDistributorRepository>();

            Distributor expDistributor = new Distributor();

            expDistributor.Address  = "pepe street.";
            expDistributor.Code     = "1234";
            expDistributor.Discount = 15;
            expDistributor.Email    = "*****@*****.**";
            expDistributor.Name     = "testing Distributor";

            Expect.Call(mockedRepos.GetByCode("1234")).Return(expDistributor);
            mock.ReplayAll();
            DistributorController dc = new DistributorController(mockedRepos);

            Distributor d = dc.GetByCode("1234");

            Assert.IsNotNull(d);
        }