Esempio n. 1
0
        public void ensureToStringWorks()
        {
            CustomizedProductSerialNumber serialNumber      = new CustomizedProductSerialNumber();
            CustomizedProductSerialNumber otherSerialNumber = new CustomizedProductSerialNumber();

            Assert.Equal(serialNumber.ToString(), otherSerialNumber.ToString());
        }
Esempio n. 2
0
        public void ensureSerialNumbersHaveSameHashCode()
        {
            CustomizedProductSerialNumber serialNumber      = new CustomizedProductSerialNumber();
            CustomizedProductSerialNumber otherSerialNumber = new CustomizedProductSerialNumber();

            Assert.Equal(serialNumber.GetHashCode(), otherSerialNumber.GetHashCode());
        }
Esempio n. 3
0
        public void ensureNewInstanceHasAnInitialSerialNumberOfZero()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            string expected = "0";

            Assert.Equal(expected, serialNumber.serialNumber);
        }
Esempio n. 4
0
        public void ensureSerialNumbersHaveDifferentHashCodes()
        {
            CustomizedProductSerialNumber serialNumber      = new CustomizedProductSerialNumber();
            CustomizedProductSerialNumber otherSerialNumber = new CustomizedProductSerialNumber();

            serialNumber.incrementSerialNumber();

            Assert.NotEqual(serialNumber.GetHashCode(), otherSerialNumber.GetHashCode());
        }
Esempio n. 5
0
        public void ensureSameAs()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            serialNumber.incrementSerialNumber();

            string expected = "1";

            Assert.True(serialNumber.sameAs(expected));
        }
Esempio n. 6
0
        public void ensureIncrementSerialNumberChangesSerialNumber()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            serialNumber.incrementSerialNumber();

            string expected = "1";

            Assert.Equal(expected, serialNumber.serialNumber);
        }
Esempio n. 7
0
        public void ensureSerialNumbersAreNotEqual()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            CustomizedProductSerialNumber otherSerialNumber = new CustomizedProductSerialNumber();

            serialNumber.incrementSerialNumber();

            Assert.NotEqual(serialNumber, otherSerialNumber);
        }
        public CustomizedProductSerialNumber increment()
        {
            CustomizedProductSerialNumber serialNumber = findSerialNumber();

            serialNumber.incrementSerialNumber();

            dbContext.Entry(serialNumber).State = EntityState.Modified;
            dbContext.SaveChanges();

            return(serialNumber);
        }
Esempio n. 9
0
        public void ensureIdReturnsTheSerialNumber()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            serialNumber.incrementSerialNumber();

            string expected = "1";

            Assert.Equal(expected, serialNumber.id());
            Assert.Equal(serialNumber.serialNumber, serialNumber.id());
        }
        public CustomizedProductSerialNumber findSerialNumber()
        {
            CustomizedProductSerialNumber instance = dbContext.CustomizedProductSerialNumber.SingleOrDefault();

            if (instance == null)
            {
                instance = new CustomizedProductSerialNumber();
                dbContext.CustomizedProductSerialNumber.Add(instance);
                dbContext.SaveChanges();
            }

            return(instance);
        }
Esempio n. 11
0
        public void ensureConstructorCreatesInstance()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            Assert.NotNull(serialNumber);
        }
Esempio n. 12
0
        public void ensureDifferentObjectTypeIsNotEqual()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            Assert.False(serialNumber.Equals("string here"));
        }
Esempio n. 13
0
        public void ensureNullIsNotEqual()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            Assert.False(serialNumber.Equals(null));
        }
Esempio n. 14
0
        public void ensureSerialNumberIsEqualToItself()
        {
            CustomizedProductSerialNumber serialNumber = new CustomizedProductSerialNumber();

            Assert.True(serialNumber.Equals(serialNumber));
        }