Exemplo n.º 1
0
        // GET: api/Activation
        public IEnumerable <Activation> Get()
        {
            ActivationList activations = new ActivationList();

            activations.Load();
            return(activations);
        }
Exemplo n.º 2
0
        public void LoadTest()
        {
            ActivationList activations = new ActivationList();

            activations.Load();

            int expected = 3;
            int actual   = activations.Count;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void DeleteTest()
        {
            //Load all activations and then get the activation
            ActivationList activations = new ActivationList();

            activations.Load();
            Activation activation = activations.FirstOrDefault(a => a.ActivationCode == "updte");

            int rowsAffected = activation.Delete();

            Assert.IsTrue(rowsAffected == 1);
        }
Exemplo n.º 4
0
        public void UpdateTest()
        {
            //Load all activations and then get the activation
            ActivationList activations = new ActivationList();

            activations.Load();
            Activation activation = activations.FirstOrDefault(a => a.QuestionId == Guid.Empty);

            //Change the properties
            activation.ActivationCode = "updte";

            //Update the activation
            int rowsAffected = activation.Update();


            Assert.IsTrue(rowsAffected == 1);
        }