Esempio n. 1
0
 public void GetSitesExceptionStateTest()
 {
     SiteService siteservice = new SiteService(new RepositoryMock<Site>(), new RepositoryMock<Measurement>());
     siteservice.GetSites(null);
 }
Esempio n. 2
0
        public void GetSitesTest()
        {
            SiteService target = new SiteService(new RepositoryMock<Site>(), new RepositoryMock<Measurement>());
            Customer customer = new Customer()
            {
                Person = new Person()
                {
                    Email = "*****@*****.**",
                    Firstname = "PersonVorname",
                    Lastname = "PersonNachname",
                    Password = "******",
                    Username = "******"
                }
            };

            customer.Sites.Add(new Site()
            {
                Description = "Description",
                Latitude = 43.012312,
                Longitude = 12.12312,
                Serialnumber = "!§$%&/()",
                SiteID = 1
            });

            customer.Sites.Add(new Site()
            {
                Description = "Description",
                Latitude = 43.012312,
                Longitude = 12.12312,
                Serialnumber = "!§$%&/()",
                SiteID = 2
            });

            List<Site> expected = new List<Site>(customer.Sites);
            List<Site> actual;
            actual = target.GetSites(customer);
            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);
        }
Esempio n. 3
0
 public void GetSitesExceptionStateTest()
 {
     SiteService siteservice = new SiteService();
     siteservice.GetSites(null);
 }