Пример #1
0
        public void BeAbleToTellItIsNotEqualToANullObject()
        {
            DateField firstDateField = new DateField("Fecha");

            IField firstNewDateField = firstDateField.FillAndClone("2008-09-22T14:01:54Z");

            Assert.IsFalse(firstNewDateField.Equals(null));
        }
Пример #2
0
        public void ReturnANewIFieldWhenFilled()
        {
            DateField dateField = new DateField("Fecha");

            IField newDateField = dateField.FillAndClone("2008-09-22T14:01:54Z");

            Assert.AreNotSame(dateField, newDateField);
        }
Пример #3
0
        public void AllowToBeFilled()
        {
            DateField dateField = new DateField("Fecha");

            IField   newDateField   = dateField.FillAndClone("2008-09-22T14:01:54Z");
            DateTime expectedResult = DateTime.Parse("2008-09-22T14:01:54Z");

            Assert.AreEqual(expectedResult.ToString("yyyy-MM-ddTHH:mm:ssZ"), newDateField.GetData());
        }
Пример #4
0
        public void BeAbleToTellItIsNotEqualToAnotherDateFieldWithSameNameAndDifferentData()
        {
            DateField firstDateField  = new DateField("Fecha");
            DateField secondDateField = new DateField("Fecha");

            IField firstNewDateField  = firstDateField.FillAndClone("2008-09-22T14:01:54Z");
            IField secondNewDateField = secondDateField.FillAndClone("2015-10-26T14:01:54Z");

            Assert.IsFalse(firstNewDateField.Equals(secondNewDateField));
        }
Пример #5
0
        public void BeAbleToTellItIsNotEqualToAnotherTypeOfField()
        {
            DateField aDateField = new DateField("Fecha");

            IField aNewDateField = aDateField.FillAndClone("2008-09-22T14:01:54Z");

            NumberField aNumberField = new NumberField("Monto");

            Assert.IsFalse(aNewDateField.Equals(aNumberField));
        }
Пример #6
0
        public void HaveTheNecessaryCompletedFields()
        {
            List <IField> list        = new List <IField>();
            DateField     datefield   = new DateField("Fecha");
            NumberField   numberField = new NumberField("Monto");

            list.Add(numberField);
            list.Add(datefield);
            Provider      provider             = new Provider("Antel", 20, list);
            IField        completedDateField   = datefield.FillAndClone("2012-09-17T22:02:51Z");
            IField        completedNumberField = numberField.FillAndClone("8000");
            List <IField> completedFields      = new List <IField>();

            completedFields.Add(completedDateField);
            completedFields.Add(completedNumberField);

            Receipt receipt = new Receipt(provider, completedFields, 0);
        }
Пример #7
0
        public void FailWhenTheProvidedDateIsNotInGMTFormat()
        {
            DateField dateField = new DateField("Fecha");

            IField newDateField = dateField.FillAndClone("05/09/2016");
        }
Пример #8
0
        public void FailWhenDataToBeFilledWithIsNotValidDateTime()
        {
            DateField dateField = new DateField("Fecha");

            IField newDateField = dateField.FillAndClone("hola");
        }
Пример #9
0
        public void FailWhenDataToBeFilledWithIsNull()
        {
            DateField dateField = new DateField("Fecha");

            IField newDateField = dateField.FillAndClone(null);
        }