Esempio n. 1
0
        public Confirmation Create(string name)
        {
            Enumeration enumeration = new Enumeration(name);
            enumeration = enumerationRepository.SaveOrUpdate(enumeration);

            return Confirmation.CreateSuccessConfirmation("The enumeration \"" + name + "\" was changed successfully.", enumeration.Id);
        }
Esempio n. 2
0
        public void CanCompareEnumerations()
        {
            Enumeration instance = new Enumeration("Sample Name");

            Enumeration instanceToCompareTo = new Enumeration("Sample Name");

            instance.ShouldEqual(instanceToCompareTo);
        }
Esempio n. 3
0
        public void CanChangeName()
        {
            //Establish Context
            Enumeration enumeration = new Enumeration("Sample Name");

            //Act
            enumeration.ChangeName("Changed Name");

            //Assert
            enumeration.Name.ShouldEqual("Changed Name");
        }
Esempio n. 4
0
        public void CanDeactivateEnumeration()
        {
            //Establish Context
            Enumeration enumeration = new Enumeration("Sample Name");
            enumeration.Activate();
            enumeration.Active.ShouldBeTrue();

            //Act
            enumeration.Deactivate();

            //Assert
            enumeration.Active.ShouldBeFalse();
        }