private async void ExecuteRotation(PhotoHalfPairTile tmp) { const float degreeStep = 15.0f; const int delayMicrosecond = 15; _Busy.Take(tmp); tmp.IsRotating = true; tmp.Flipped = true; while (tmp.Deg <= 90 - degreeStep) { await Task.Delay(delayMicrosecond); await Device.InvokeOnMainThreadAsync(() => tmp.Deg = tmp.Deg + degreeStep); } while (tmp.Deg >= 0 + degreeStep) { await Task.Delay(delayMicrosecond); await Device.InvokeOnMainThreadAsync(() => tmp.Deg = tmp.Deg - degreeStep); } tmp.Deg = 0; tmp.IsRotating = false; if (_Busy.State.Equals(BusyStates.Filled) || _Busy.State.Equals(BusyStates.Right)) { int SRow = _Busy.Second.Row; int SCol = _Busy.Second.Col; while (tmp.IsRotating || tiles[SRow][SCol].IsRotating) { continue; } } if (_Busy.State.Equals(BusyStates.Right)) { ConfigEventArgs args = new ConfigEventArgs { FRow = _Busy.First.Row, FCol = _Busy.First.Col, SRow = _Busy.Second.Row, SCol = _Busy.Second.Col }; RightConfiguration?.Invoke(this, args); } if (_Busy.State.Equals(BusyStates.Filled)) { ConfigEventArgs args = new ConfigEventArgs { FRow = _Busy.First.Row, FCol = _Busy.First.Col, SRow = _Busy.Second.Row, SCol = _Busy.Second.Col }; WrongConfiguration?.Invoke(this, args); } }
public void CreateFromThrowsInvalidProviderExceptionIfUnknownProvider() { //Arrange IConfiguration config = new WrongConfiguration { }; //Act ActualValueDelegate <object> testDelegate = () => factory.CreateFrom(config); //Assert Assert.That(testDelegate, Throws.TypeOf <InvalidProviderException>()); }