Exemple #1
0
        public void SetPlacedOnDate()
        {
            PhoneOrderEntity orderInstance;
            var factory = new PhoneOrderEntityFactory();
            var time    = DateTime.UtcNow;

            factory.SetPlacedOnDate(time);
            orderInstance = factory.GetInstance();

            Assert.AreEqual(time, orderInstance.PlacedOn);
        }
Exemple #2
0
        public String CreateDefaultOrder()
        {
            ResponseDTO responseDTO = new ResponseDTO();

            phoneOrderEntityFactory.GenerateId();
            phoneOrderEntityFactory.SetName("John", "Smith");
            phoneOrderEntityFactory.SetStreet("356 Rosewood");
            phoneOrderEntityFactory.SetCity("Happyville");
            phoneOrderEntityFactory.SetZipcode(31415);
            phoneOrderEntityFactory.SetPhoneNumber("555-5555");
            phoneOrderEntityFactory.SetStatus(PhoneOrderEntity.ApprovalStatus.Open);
            phoneOrderEntityFactory.SetPlacedOnDate(DateTime.Now);
            PhoneOrderEntity defaultOrder = phoneOrderEntityFactory.GetInstance();

            phoneOrderRepository.InsertPhoneOrder(defaultOrder);

            responseDTO.Result = "Done";

            return(JsonConvert.SerializeObject(responseDTO));
        }