-1
을 제공합니다.단위 테스트는 내가</p> <p>인터페이스가 무엇 IConvertible 예외를
단위 테스트 :
static Guid docGuid = Guid.NewGuid();
[TestMethod]
public async Task TestMethod2()
{
var jObject = new JObject { { "id", docGuid }, { "studentId", "1" }, { "courseId", "Ph" } };
// Arrange
var docClient = new ShimDocumentClient();
ShimDocumentClient.AllInstances.CreateDocumentAsyncUriObjectRequestOptionsBoolean =
(instance, uri, document, options, disableAutomaticGeneration) => Task.FromResult(new ResourceResponse<Document>(new Document() { Id = docGuid.ToString() }));
// Act
var documentRepository = new DocDbRepository(endPointUri, accountKey, dbName, collectionName);
try{
var response = await documentRepository.UpdateDocumentAsync(jObject).ConfigureAwait(false);
}
catch(Exception ex){}
// Assert
Assert.AreEqual(response.Count, 1);
}
이 시험은이 메시지와 함께 UpdateDocumentAsync 부분과 종료를 넘어되지 않습니다
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Linq.Extensions.Convert[T,U](T token)
at Newtonsoft.Json.Linq.Extensions.Value[T,U](IEnumerable`1 value)
at Newtonsoft.Json.Linq.Extensions.Value[U](IEnumerable`1 value)
at Common.DataAccess.DocumentDb.DocDbRepository.<UpdateDocumentAsync>d__12.MoveNext() in C:\Common\Common.DataAccess.DocumentDb\DocDbRepository.cs:line 196
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Common.DataAccess.DocumentDb.Tests.DocDbUtilityTests.<TestMethod2>d__9.MoveNext() in C:\Common\Common.DataAccess.DocumentDb.Tests\DocDbUtilityTests.cs:line 113
이 가짜 프레임 워크 내 처음이다. 도움을 주시면 대단히 감사하겠습니다.
미리 감사드립니다. 감사합니다.
예외가 발생한 줄은 무엇입니까? 전체 예외 세부 사항을 포함시키는 것이 도움이 될 수 있습니다. –
예외 세부 사항 및 발생한 행이 업데이트됩니다. – Codehelp