Exemplo n.º 1
0
        public void Reset()
        {
            PhoneOrderEntity orderInstance;
            var      factory   = new PhoneOrderEntityFactory();
            Guid     emptyGuid = Guid.Parse("00000000-0000-0000-0000-000000000000");
            DateTime emptyTime = DateTime.FromBinary(0);

            factory.SetName("a", "b");
            factory.SetPhoneNumber("5555");
            factory.SetStreet("444 street");
            factory.SetCity("some city");
            factory.SetZipcode(12345);
            factory.GenerateId();
            factory.GeneratePlacedOnDate();
            factory.SetStatus(PhoneOrderEntity.ApprovalStatus.Open);
            factory.Reset();
            orderInstance = factory.GetInstance();

            Assert.Null(orderInstance.FirstName);
            Assert.Null(orderInstance.LastName);
            Assert.Null(orderInstance.Phone);
            Assert.Null(orderInstance.Street);
            Assert.Null(orderInstance.City);
            Assert.AreEqual(0, orderInstance.Zipcode);
            Assert.NotNull(orderInstance.Id);
            Assert.AreEqual(emptyGuid, orderInstance.Id);
            Assert.NotNull(orderInstance.PlacedOn);
            Assert.AreEqual(emptyTime, orderInstance.PlacedOn);
            Assert.AreEqual(PhoneOrderEntity.ApprovalStatus.PendingApproval, orderInstance.Status);
        }