public void Enum_DontThrowIfEqual() { var expected = EnumData.Cat; var result = EnumData.Cat; DeepAssert.Equal(expected, result); }
public void PrivateProperties_DontThrowIfDifferent() { var expected = new PrivatePropertyData(1); var result = new PrivatePropertyData(2); DeepAssert.Equal(expected, result); }
public void List_DontThrowIfSameContent() { var expected = new[] { 1 }; var result = new[] { 1 }; DeepAssert.Equal(expected, result); }
public void CanGetHandler() { var expected = new TestHandler(); var actual = Sut <TestHandler>().GetHandler("test", new InMemoryConfiguration(), new ResponseContext()); DeepAssert.Equal(expected, actual); }
public void CanGetHandlerWithDefaultArguments() { var expected = new TestHandlerWithMultipleArguments(null, null, null, 0); var actual = Sut <TestHandlerWithMultipleArguments>().GetHandler("test", null, null); DeepAssert.Equal(expected, actual); }
public async Task GetAll_Single_SeededWater() { var ingredients = await _ingredientFacadeSUT.GetAsync(); var ingredient = ingredients.Single(i => i.Id == IngredientSeeds.Water.Id); DeepAssert.Equal(Mapper.Map <IngredientListModel>(IngredientSeeds.Water), ingredient); }
public async Task ApplicantAddIdDocs(string documentFilePath, string documentContentType) { var applicant = await CreateApplicantAsync(); var idDoc = _fixture.Create <IdDoc>(); var actualIdDoc = await AddApplicantIdDoc(applicant.Id, idDoc, documentFilePath, documentContentType); DeepAssert.Equal(actualIdDoc, idDoc); }
public void MapMapEqual() { var from = new IpGeo { ContinentCode = "a", CountryCode = "b", Latitude = 1, Longitude = 2, YourIp = "0.3.0.0", Timestamp = DateTimeOffset.UtcNow }; var toFrom = from.To <IpGeoTableEntity>().To <IpGeo>(); DeepAssert.Equal(from, toFrom); }
public async Task ApplicantSetIdDocs() { var applicant = await CreateApplicantAsync(); var idDocs = _fixture.Create <ApplicantIdDocs>(); var actualIdDocs = await Client.SetApplicantIdDocsAsync(applicant.Id, idDocs); DeepAssert.Equal(actualIdDocs, idDocs); }
public async Task ApplicantChangeInfo() { var applicant = await CreateApplicantAsync(); var info = _fixture.Create <Info>(); var actualInfo = await Client.ChangeApplicantDataAsync(applicant.Id, null, info); DeepAssert.Equal(actualInfo, info); }
public async Task ApplicantCreate() { var model = _fixture.Create <ApplicantRequest>(); var applicant = await Client.CreateApplicantAsync(model); DeepAssert.Equal(applicant.Info, model.Info); Assert.Equal("test-api", applicant.Env); }
public void SanitizePathString(string path, string expectedPath) { // Given // When var actual = _operatingSystemLayerLinux.SanitizePath(path); // Then DeepAssert.Equal(expectedPath, actual); }
public void KitchenSink() { var object1 = new { A = 1, B = UriKind.Absolute, C = new List <int> { 1, 2, 3 }, Float = 1.111_111_8f, Double = 1.111_111_111_111_118d, Inner = new { X = 1, Y = 2, Z = 3 }, Set = new[] { 3, 4, 2, 1 }, Dictionary = new Dictionary <int, int> { { 2, 3 }, { 123, 234 }, { 345, 456 } } }; var object2 = new { A = 1, B = "Absolute", C = new[] { 1, 2, 3 }, Float = 1.111_111_9m, Double = 1.111_111_111_111_119m, Inner = new TestType { X = 1, Y = 3, Z = 3 }, Set = new HashSet <int> { 1, 2, 3, 4 }, Dictionary = new Dictionary <int, int> { { 123, 234 }, { 345, 456 }, { 2, 3 } } }; var comparison = new ComparisonBuilder() .IgnoreProperty <TestType>(x => x.Y) .Create(); DeepAssert.AreEqual(object1, object2, comparison); }
public async Task ApplicantGetIdDocs() { var applicant = await CreateApplicantAsync(); var applicationIdDocs = await CreateApplicantIdDocs(applicant); var actualIdDocs = await Client.SetApplicantIdDocsAsync(applicant.Id, null); DeepAssert.Equal(actualIdDocs, applicationIdDocs); }
public void NullablePrimitive_ThrowIfResultOnlyNull() { int?expected = 5; int?result = null; Assert.Throws <DeepAssertException>(() => { DeepAssert.Equal(expected, result); }); }
public void List_ThrowIfExpectedLonger() { var expected = new[] { 1, 2 }; var result = new[] { 1 }; Assert.Throws <DeepAssertException>(() => { DeepAssert.Equal(expected, result); }); }
public void CanGetHandlerWithServices() { var expected = new TestHandlerWithServices(new TestService { Test = "Test" }); var actual = Sut <TestHandlerWithServices>().GetHandler("test", null, null); DeepAssert.Equal(expected, actual); }
public void CanMockRequest() { var ctx = GetRouteContext(x => x.WithResponse(Schema.Object())); var expected = ResponseContext(); var actual = Sut.HandleAsync(ctx).Result; DeepAssert.Equal(expected, actual); }
public void List_ThrowIfDifferentContent() { var expected = new[] { 1 }; var result = new[] { 2 }; Assert.Throws <DeepAssertException>(() => { DeepAssert.Equal(expected, result); }); }
public void AllowHandlerToReturnNull() { var sut = Sut(typeof(TestHandlerNull)); var expected = new ResponseContext(); var actual = sut.HandleAsync(RouteContext).Result; DeepAssert.Equal(expected, actual); }
public void CanBreakPipeline() { var sut = Sut(typeof(TestHandlerBreaks), typeof(TestHandler1)); var expected = TestHandlerBreaks.Response; var actual = sut.HandleAsync(RouteContext).Result; DeepAssert.Equal(expected, actual); }
public void CanPassPreviousResponseToHandler() { var sut = Sut(typeof(TestHandler1), typeof(TestHandlerWithPreviousResponse)); var expected = TestHandler1.Response; var actual = sut.HandleAsync(RouteContext).Result; DeepAssert.Equal(expected, actual); }
public void CanRunPipelineWithMultipleHandlers() { var sut = Sut(typeof(TestHandler1), typeof(TestHandler2)); var expected = TestHandler2.Response; var actual = sut.HandleAsync(RouteContext).Result; DeepAssert.Equal(expected, actual); }
public async Task GetScanStatus() { var expected = new ScanStatus(); var actual = await NetverifyClient.GetScanStatusAsync(_scanReference); expected.Status = ScanStatusStatus.DONE; expected.ScanReference = _scanReference; DeepAssert.Equal(expected, actual, "Timestamp"); // Сравни все поля кроме Timestamp Assert.IsType <ScanStatus>(actual); }
public void Enum_ThrowIfDifferent() { var expected = EnumData.Cat; var result = EnumData.Unicorn; Assert.Throws <DeepAssertException>(() => { DeepAssert.Equal(expected, result); }); }
public void NullablePrimitive_ThrowIfDifferent() { int?expected = 5; int?result = 3; Assert.Throws <DeepAssertException>(() => { DeepAssert.Equal(expected, result); }); }
public void Primitive_DontThrowIfEqual() { var expected = new IntegerData { Value = 1 }; var result = new IntegerData { Value = 1 }; DeepAssert.Equal(expected, result); }
public async Task GetById_FromSeeded_DoesNotThrowAndEqualsSeeded() { //Arrange var detailModel = Mapper.Map <RecipeDetailModel>(RecipeSeeds.RecipeEntity); //Act var returnedModel = await _facadeSUT.GetAsync(detailModel.Id); //Assert DeepAssert.Equal(detailModel, returnedModel); }
public void CanGetHandlerWithResponseContext() { var responseContext = new ResponseContext { Body = "Test" }; var expected = new TestHandlerWithResponseContext(responseContext); var actual = Sut <TestHandlerWithResponseContext>().GetHandler("test", null, responseContext); DeepAssert.Equal(expected, actual); }
public void CanGetHandlerWithOptions() { var config = new InMemoryConfiguration("", ("test", "42")); var expected = new TestHandlerWithOptions(new TestOptions { Test = "42" }); var actual = Sut <TestHandlerWithOptions>().GetHandler("test", config, null); DeepAssert.Equal(expected, actual); }