public void ToExpectMapAllProperties() { var dto = new DeliveryDto { Id = "expectedId", Recipient = new RecipientDto(), AccessWindow = new AccessWindowDto(), Order = new OrderDto(), State = DeliveryState.Completed }; var expectedRecipient = new Recipient(); _mockRecipientMapper.Setup(mapper => mapper.To(dto.Recipient)).Returns(expectedRecipient); var expectedAccessWindow = new AccessWindow(); _mockAccessWindowMapper.Setup(mapper => mapper.To(dto.AccessWindow)).Returns(expectedAccessWindow); var expectedOrder = new Order(); _mockOrderMapper.Setup(mapper => mapper.To(dto.Order)).Returns(expectedOrder); var actual = _deliveryMapper.To(dto); Assert.NotNull(actual); Assert.Equal(dto.Id, actual.Id); Assert.Equal(expectedOrder, actual.Order); Assert.Equal(expectedRecipient, actual.Recipient); Assert.Equal(expectedAccessWindow, actual.AccessWindow); Assert.Equal(dto.State, actual.State); }
/// /// \brief Second initialization /// /// \return No return value /// /// \details Creates the access denied UI and window. Starts the auto break system /// void Start() { AccessUI = Instantiate(AccessUIPrefab); AWin = new AccessWindow(AccessUI); AccessUI.GetComponentInChildren <Button>().onClick.AddListener(delegate { showAccess(false); }); //Debug.LogWarning(name + ":" + uiPrefab.name); AccessUI.transform.SetParent(UICanvas.Canvas.transform, false); AccessUI.SetActive(false); InvokeRepeating("tryBreak", waitSec, repeatSec); }
public AccessWindowDto From(AccessWindow to) { if (to == null) { return(null); } return(new AccessWindowDto { StartTime = to.StartTime, EndTime = to.EndTime }); }
public void FromExpectMapAllProperties() { var entity = new AccessWindow { StartTime = DateTime.Now, EndTime = DateTime.Now }; var actual = _accessWindowMapper.From(entity); Assert.NotNull(actual); Assert.Equal(entity.StartTime, actual.StartTime); Assert.Equal(entity.EndTime, actual.EndTime); }