Beispiel #1
0
        public RoomServiceAsyncTests()
        {
            this.service = new RoomService(new RoomRepository(new DataContext("defaultconnection")));

            service.AddAsync(new Room
            {
                Number    = "123",
                SitsCount = 15
            }).Wait();

            service.AddAsync(new Room
            {
                Number    = "124",
                SitsCount = 17
            }).Wait();
        }
Beispiel #2
0
        public void AddTest()
        {
            var name = Guid.NewGuid().ToString();

            var newGroup = new Room
            {
                Number = name
            };

            var addedGroupTask = service.AddAsync(newGroup);

            var addedGroup = addedGroupTask.Result;

            Assert.IsNotNull(addedGroup);
            Assert.IsTrue(addedGroup.Id > 0);
            Assert.AreEqual(addedGroup.Number, name);
        }